mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-06-06 23:57:21 +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 (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
@ -56,8 +55,8 @@ func RunConfigUpdate(fromVersion int, toVersion int) {
|
||||
|
||||
//Do iterate update
|
||||
for i := fromVersion; i < toVersion; i++ {
|
||||
oldVersion := fromVersion
|
||||
newVersion := fromVersion + 1
|
||||
oldVersion := i
|
||||
newVersion := i + 1
|
||||
fmt.Println("Updating from v", oldVersion, " to v", newVersion)
|
||||
runUpdateRoutineWithVersion(oldVersion, newVersion)
|
||||
//Write the updated version to file
|
||||
@ -92,7 +91,7 @@ func isFirstTimeInitialize(path string) (bool, error) {
|
||||
}
|
||||
|
||||
// Read the directory contents
|
||||
files, err := ioutil.ReadDir(path)
|
||||
files, err := os.ReadDir(path)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user