Skip to content

Commit

Permalink
3.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Icaruk committed Jun 25, 2023
1 parent de0b1a2 commit 367fe58
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/updater/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func init() {

localVersionPath := filepath.Join(filepath.Dir(binaryPath), "../.version")

localVersion := "0.0.0"
localVersion := "3.1.4"
localVersionByte, err := os.ReadFile(localVersionPath)
if err == nil {
localVersion = string(localVersionByte)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "up-npm",
"version": "3.1.3",
"version": "3.1.4",
"author": "Icaruk",
"scripts": {
"postinstall": "node ./scripts/setup.js"
Expand Down
9 changes: 6 additions & 3 deletions pkg/updater/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -683,8 +683,8 @@ func Init(cfg CmdFlags) {
if response == updatePackageOptions.update {
// get a copy of the entry
if entry, ok := versionComparison[key]; ok {
entry.shouldUpdate = true // then modify the copy
versionComparison[key] = entry // then reassign map entry
entry.shouldUpdate = true // modify the copy
versionComparison[key] = entry // reassign map entry
}
updateProgressCount++
break
Expand Down Expand Up @@ -758,7 +758,10 @@ func Init(cfg CmdFlags) {
dependenciesKeyName = "devDependencies"
}

dotPath := fmt.Sprintf("%s.%s", dependenciesKeyName, key)
// replace "key" characters like "." and replace with "\."
safeKey := strings.ReplaceAll(key, ".", "\\.")

dotPath := fmt.Sprintf("%s.%s", dependenciesKeyName, safeKey)
latestVersion := fmt.Sprintf("%s%s", value.versionPrefix, value.latest)

jsonFileStr, _ = sjson.Set(jsonFileStr, dotPath, latestVersion)
Expand Down

0 comments on commit 367fe58

Please sign in to comment.