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