Prompt for backup location during re-onboard instead of skipping
When step 4 finds an existing backup repo, show the current location and ask to reconfigure with the existing path as default, rather than silently skipping the step. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
14
cli/pal.lux
14
cli/pal.lux
@@ -1411,13 +1411,16 @@ fn doOnboardSteps(): Unit with {Console, Process} = {
|
|||||||
printHint("Install restic and run 'pal backup init <repo>' later.")
|
printHint("Install restic and run 'pal backup init <repo>' later.")
|
||||||
} else {
|
} else {
|
||||||
let existingRepo = getBackupRepo()
|
let existingRepo = getBackupRepo()
|
||||||
if String.length(existingRepo) > 0 then {
|
let setupBackup = if String.length(existingRepo) > 0 then {
|
||||||
printStep("Backup repository", "already configured")
|
printHint("Current repository: " + existingRepo)
|
||||||
printHint("Repository: " + existingRepo)
|
print("")
|
||||||
|
askConfirm("Reconfigure backup location?", false)
|
||||||
} else {
|
} else {
|
||||||
let setupBackup = askConfirm("Set up backups?", true)
|
askConfirm("Set up backups?", true)
|
||||||
|
}
|
||||||
print("")
|
print("")
|
||||||
if setupBackup then {
|
if setupBackup then {
|
||||||
|
let defaultRepo = existingRepo
|
||||||
printHint("Enter a path or URL where backup snapshots will be stored.")
|
printHint("Enter a path or URL where backup snapshots will be stored.")
|
||||||
print("")
|
print("")
|
||||||
let ignore15b = Process.exec("printf ' \\033[36mLocal directory\\033[0m /mnt/backup, /media/usb/backups\\n' >&2")
|
let ignore15b = Process.exec("printf ' \\033[36mLocal directory\\033[0m /mnt/backup, /media/usb/backups\\n' >&2")
|
||||||
@@ -1425,7 +1428,7 @@ fn doOnboardSteps(): Unit with {Console, Process} = {
|
|||||||
let ignore15d = Process.exec("printf ' \\033[36mBackblaze B2\\033[0m b2:bucket-name:path\\n' >&2")
|
let ignore15d = Process.exec("printf ' \\033[36mBackblaze B2\\033[0m b2:bucket-name:path\\n' >&2")
|
||||||
let ignore15e = Process.exec("printf ' \\033[36mAmazon S3\\033[0m s3:bucket-name/path\\n' >&2")
|
let ignore15e = Process.exec("printf ' \\033[36mAmazon S3\\033[0m s3:bucket-name/path\\n' >&2")
|
||||||
print("")
|
print("")
|
||||||
let backupRepo = askInput("Backup location", "")
|
let backupRepo = askInput("Backup location", defaultRepo)
|
||||||
if String.length(backupRepo) == 0 then {
|
if String.length(backupRepo) == 0 then {
|
||||||
printHint("Skipping backup setup.")
|
printHint("Skipping backup setup.")
|
||||||
printCmd("pal backup init <repo>")
|
printCmd("pal backup init <repo>")
|
||||||
@@ -1460,7 +1463,6 @@ fn doOnboardSteps(): Unit with {Console, Process} = {
|
|||||||
printCmd("pal backup init <repo>")
|
printCmd("pal backup init <repo>")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
print("")
|
print("")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user