|
@@ -19,6 +19,29 @@ func restoreConfigs() {
|
|
restoreIfExists("web/SystemAO/vendor/")
|
|
restoreIfExists("web/SystemAO/vendor/")
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+func restoreOldArozOS() {
|
|
|
|
+ fmt.Println("[LAUNCHER] ArozOS unable to launch. Restoring from backup")
|
|
|
|
+ if fileExists("arozos.old") {
|
|
|
|
+ backupfiles, err := filepath.Glob("arozos.old/*")
|
|
|
|
+ if err != nil {
|
|
|
|
+ fmt.Println("[LAUNCHER] Unable to restore backup. Exiting.")
|
|
|
|
+ os.Exit(1)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for _, thisBackupFile := range backupfiles {
|
|
|
|
+ if isDir(thisBackupFile) {
|
|
|
|
+ cp.Copy(thisBackupFile, "./"+filepath.Base(thisBackupFile))
|
|
|
|
+ } else {
|
|
|
|
+ copy(thisBackupFile, "./"+filepath.Base(thisBackupFile))
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ fmt.Println("[LAUNCHER] ArozOS backup not found. Exiting.")
|
|
|
|
+ os.Exit(1)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
func restoreIfExists(fileRelPath string) {
|
|
func restoreIfExists(fileRelPath string) {
|
|
if fileExists(filepath.Join("arozos.old", fileRelPath)) {
|
|
if fileExists(filepath.Join("arozos.old", fileRelPath)) {
|
|
if !isDir(filepath.Join("arozos.old", fileRelPath)) {
|
|
if !isDir(filepath.Join("arozos.old", fileRelPath)) {
|