Skip to content
This repository has been archived by the owner on May 8, 2022. It is now read-only.

Commit

Permalink
Remove old data in settings before recovering from backup. Closes #9
Browse files Browse the repository at this point in the history
  • Loading branch information
SCP002 committed Apr 1, 2022
1 parent 17c424d commit d5dd00e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ func xteveRestore(archive string) (newWebURL string, err error) {
return
}

if err = os.RemoveAll(System.Folder.Config); err != nil {
ShowError(err, 1073)
}

// Extract the ZIP Archive into the Config Folder
err = extractZIP(archive, System.Folder.Config)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion src/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func updateServerSettings(request RequestStruct) (settings SettingsStruct, err e
}

if err != nil {
showWarning(1015)
ShowError(err, 1015)
value = os.TempDir() + string(os.PathSeparator)
err = checkFilePermission(value.(string))
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions src/screen.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ func getErrMsg(errCode int) (errMsg string) {
errMsg = fmt.Sprintf("File could not be created")
case 1072:
errMsg = fmt.Sprintf("File not found")
case 1073:
errMsg = fmt.Sprintf("Can not remove old config folder before recover")

// Backup
case 1090:
Expand Down

0 comments on commit d5dd00e

Please sign in to comment.