Allow preparing backups
This commit is contained in:
parent
68d0c889a9
commit
72b9f93a82
1 changed files with 13 additions and 6 deletions
|
@ -3,8 +3,8 @@ begin
|
||||||
set -l dir (status dirname)
|
set -l dir (status dirname)
|
||||||
|
|
||||||
set -l backupActions \
|
set -l backupActions \
|
||||||
backup backupSW backupArgs getBackupArgs restore restoreSW \
|
backup backupSW prepareBackup prepareBackup backupArgs getBackupArgs restore restoreSW \
|
||||||
userBackup userBackup userBackupArgs getUserBackupArgs userRestore userRestore
|
userBackup userBackup prepareUserBackup prepareUserBackup userBackupArgs getUserBackupArgs userRestore userRestore
|
||||||
|
|
||||||
set -l actions \
|
set -l actions \
|
||||||
install installSW \
|
install installSW \
|
||||||
|
@ -17,13 +17,14 @@ begin
|
||||||
functions -e "$actions[$i]"
|
functions -e "$actions[$i]"
|
||||||
end
|
end
|
||||||
|
|
||||||
for i in (seq 1 6 (count $backupActions))
|
for i in (seq 1 8 (count $backupActions))
|
||||||
|
set -l preRun $backupActions[(math $i + 3)]
|
||||||
set -l function $backupActions[(math $i + 1)]
|
set -l function $backupActions[(math $i + 1)]
|
||||||
set -l getArgs $backupActions[(math $i + 3)]
|
set -l getArgs $backupActions[(math $i + 5)]
|
||||||
set -l restore $backupActions[(math $i + 5)]
|
set -l restore $backupActions[(math $i + 7)]
|
||||||
|
|
||||||
for functionName in $function $restore
|
for functionName in $function $restore
|
||||||
function $functionName -V dir -V getArgs -V functionName -V restore
|
function $functionName -V dir -V preRun -V getArgs -V functionName -V restore
|
||||||
set -l args
|
set -l args
|
||||||
|
|
||||||
if functions -q $getArgs
|
if functions -q $getArgs
|
||||||
|
@ -49,6 +50,12 @@ begin
|
||||||
source "$dir/restoration.fish"
|
source "$dir/restoration.fish"
|
||||||
|
|
||||||
if [ "$functionName" != "$restore" ]
|
if [ "$functionName" != "$restore" ]
|
||||||
|
argparse -i "action=" -- $argv
|
||||||
|
|
||||||
|
if functions -q "$preRun"
|
||||||
|
"$preRun" $argv
|
||||||
|
end
|
||||||
|
|
||||||
backupFiles $args
|
backupFiles $args
|
||||||
else
|
else
|
||||||
restoreFiles $args
|
restoreFiles $args
|
||||||
|
|
Loading…
Reference in a new issue