1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/distbin_ynh.git synced 2024-09-03 18:26:10 +02:00

Fix update

This commit is contained in:
yalh76 2019-02-09 02:57:23 +01:00
parent 388bbfe735
commit 9012e8e722

View file

@ -124,7 +124,11 @@ ynh_system_user_create "$app" "$final_path"
# CREATE DB FOLDER # CREATE DB FOLDER
#================================================= #=================================================
mkdir -p "$final_path/db" DIRECTORY="$final_path/db"
#Move old db
if [ -d "$DIRECTORY" ]; then
mv "$final_path/db" "$final_path/distbin-db"
fi
#================================================= #=================================================
# MAKE INSTALL # MAKE INSTALL
@ -133,9 +137,13 @@ mkdir -p "$final_path/db"
chown -R "$app":"$app" "$final_path" chown -R "$app":"$app" "$final_path"
pushd $final_path pushd $final_path
ynh_use_nodejs ynh_use_nodejs
sudo -u $app env PATH=$nodejs_path npm update --production sudo -u $app env PATH=$PATH npm install --ignore-scripts
sudo -u $app env PATH=$nodejs_path npm install --production sudo -u $app env PATH=$PATH npm run build
sudo -u $app env PATH=$nodejs_path npm audit fix cp package* dist/
popd
pushd $final_path/dist
sudo -u $app env PATH=$PATH npm install --ignore-scripts --production
popd popd
#================================================= #=================================================