1
0
Fork 0
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:
yalh76 2020-04-25 21:12:37 +02:00
parent c6958fa858
commit f0ecc8ea8d
3 changed files with 21 additions and 3 deletions

View file

@ -6,7 +6,7 @@
"en": "Manage passwords and other sensitive informations", "en": "Manage passwords and other sensitive informations",
"fr": "Géres les mots de passe et autres informations sensibles" "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", "url": "https://github.com/dani-garcia/bitwarden_rs",
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",
"maintainer": { "maintainer": {

View file

@ -99,7 +99,6 @@ ynh_print_info --message="Reinstalling dependencies..."
# Define and install dependencies # Define and install dependencies
ynh_install_app_dependencies $pkg_dependencies ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# RESTORE SYSTEMD # RESTORE SYSTEMD
#================================================= #=================================================

View file

@ -139,8 +139,27 @@ then
sudo -u "$app" env PATH="$PATH" cargo build --features sqlite --release sudo -u "$app" env PATH="$PATH" cargo build --features sqlite --release
popd 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 # 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 # Remove build files and rustup
ynh_secure_remove --file="$final_path/build" ynh_secure_remove --file="$final_path/build"