mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-06-07 16:17:22 +02:00
Update update.go
Fixed bug in skip version upgrade
This commit is contained in:
parent
82f84470f7
commit
0828fd1958
@ -9,7 +9,6 @@ package update
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@ -56,8 +55,8 @@ func RunConfigUpdate(fromVersion int, toVersion int) {
|
|||||||
|
|
||||||
//Do iterate update
|
//Do iterate update
|
||||||
for i := fromVersion; i < toVersion; i++ {
|
for i := fromVersion; i < toVersion; i++ {
|
||||||
oldVersion := fromVersion
|
oldVersion := i
|
||||||
newVersion := fromVersion + 1
|
newVersion := i + 1
|
||||||
fmt.Println("Updating from v", oldVersion, " to v", newVersion)
|
fmt.Println("Updating from v", oldVersion, " to v", newVersion)
|
||||||
runUpdateRoutineWithVersion(oldVersion, newVersion)
|
runUpdateRoutineWithVersion(oldVersion, newVersion)
|
||||||
//Write the updated version to file
|
//Write the updated version to file
|
||||||
@ -92,7 +91,7 @@ func isFirstTimeInitialize(path string) (bool, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Read the directory contents
|
// Read the directory contents
|
||||||
files, err := ioutil.ReadDir(path)
|
files, err := os.ReadDir(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user