mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
helpers2.1: reintroduce the old ynh_restore as ynh_restore_everything because some apps are using it @_@
This commit is contained in:
parent
4dc59049ef
commit
50eea8fc14
1 changed files with 18 additions and 0 deletions
|
@ -225,6 +225,24 @@ ynh_restore() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Restore all files that were previously backuped in an app backup script
|
||||||
|
#
|
||||||
|
# usage: ynh_restore_everything
|
||||||
|
#
|
||||||
|
# Requires YunoHost version 2.6.4 or higher.
|
||||||
|
ynh_restore_everything() {
|
||||||
|
# Deduce the relative path of $YNH_CWD
|
||||||
|
local REL_DIR="${YNH_CWD#$YNH_BACKUP_DIR/}"
|
||||||
|
REL_DIR="${REL_DIR%/}/"
|
||||||
|
|
||||||
|
# For each destination path begining by $REL_DIR
|
||||||
|
cat ${YNH_BACKUP_CSV} | tr --delete $'\r' | grep --only-matching --no-filename --perl-regexp "^\".*\",\"$REL_DIR.*\"$" \
|
||||||
|
| while read line; do
|
||||||
|
local ARCHIVE_PATH=$(echo "$line" | grep --only-matching --no-filename --perl-regexp "^\".*\",\"$REL_DIR\K.*(?=\"$)")
|
||||||
|
ynh_restore --target="$ARCHIVE_PATH"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
# Calculate and store a file checksum into the app settings
|
# Calculate and store a file checksum into the app settings
|
||||||
#
|
#
|
||||||
# usage: ynh_store_file_checksum --file=file
|
# usage: ynh_store_file_checksum --file=file
|
||||||
|
|
Loading…
Add table
Reference in a new issue