mirror of
https://github.com/YunoHost-Apps/vaultwarden_ynh.git
synced 2024-09-03 18:26:31 +02:00
moving data folder during upgrade
This commit is contained in:
parent
c6958fa858
commit
f0ecc8ea8d
3 changed files with 21 additions and 3 deletions
|
@ -6,7 +6,7 @@
|
|||
"en": "Manage passwords and other sensitive informations",
|
||||
"fr": "Géres les mots de passe et autres informations sensibles"
|
||||
},
|
||||
"version": "1.14.2~ynh1",
|
||||
"version": "1.14.2~ynh2",
|
||||
"url": "https://github.com/dani-garcia/bitwarden_rs",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"maintainer": {
|
||||
|
|
|
@ -99,7 +99,6 @@ ynh_print_info --message="Reinstalling dependencies..."
|
|||
# Define and install dependencies
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
|
||||
|
||||
#=================================================
|
||||
# RESTORE SYSTEMD
|
||||
#=================================================
|
||||
|
|
|
@ -139,8 +139,27 @@ then
|
|||
sudo -u "$app" env PATH="$PATH" cargo build --features sqlite --release
|
||||
popd
|
||||
|
||||
# Backup files
|
||||
tmpdir="$(mktemp -d)"
|
||||
if [ -f $final_path/live/bitwarden_rs.env ]; then
|
||||
cp -af "$final_path/live/bitwarden_rs.env" "$tmpdir/."
|
||||
fi
|
||||
if [ -d $final_path/live/data ]; then
|
||||
cp -af "$final_path/live/data" "$tmpdir/."
|
||||
fi
|
||||
|
||||
# Install bitwarden_rs
|
||||
cp -a "$final_path"/build/target/release/. "$final_path"/live/.
|
||||
ynh_secure_remove --file="$final_path/live"
|
||||
cp -a "$final_path/build/target/release/." "$final_path/live/."
|
||||
|
||||
# Restore files
|
||||
if [ -f $tmpdir/bitwarden_rs.env ]; then
|
||||
cp -af "$tmpdir/bitwarden_rs.env" "$final_path/live/."
|
||||
fi
|
||||
if [ -d $tmpdir/data ]; then
|
||||
cp -af "$tmpdir/data" "$final_path/live/."
|
||||
fi
|
||||
ynh_secure_remove --file="$tmpdir"
|
||||
|
||||
# Remove build files and rustup
|
||||
ynh_secure_remove --file="$final_path/build"
|
||||
|
|
Loading…
Add table
Reference in a new issue