1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/codimd_ynh.git synced 2024-09-03 18:16:32 +02:00
This commit is contained in:
ericgaspar 2022-02-01 16:54:14 +01:00
parent ac27fff382
commit bbbb9fed1a
No known key found for this signature in database
GPG key ID: 574F281483054D44
2 changed files with 12 additions and 13 deletions

View file

@ -125,14 +125,13 @@ popd
#=================================================
# MODIFY A CONFIG FILE
#=================================================
ynh_script_progression --message="Modifying a config file..."
ynh_script_progression --message="Modifying a config file..." --weight=1
path=${path_url:1}
ynh_add_config --template="../conf/config.json.example" --destination="$final_path/config.json"
chmod 600 $final_path/config.json
ynh_add_config --template="../conf/.sequelizerc.example" --destination="$final_path/.sequelizerc"
chmod 600 $final_path/.sequelizerc
chmod 600 $final_path/config.json
chmod 600 $final_path/.sequelizerc
chmod +x $final_path/app.js
#=================================================
@ -145,7 +144,7 @@ ynh_add_systemd_config
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..."
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="Collaborative Markdown notes" --log="/var/log/$app/$app.log"

View file

@ -82,24 +82,24 @@ then
ynh_script_progression --message="Upgrading source files..." --weight=16
# Create a temporary directory
tmpdir="$(mktemp -d)"
#tmpdir="$(mktemp -d)"
# Backup the config file in the temp dir
cp -a "$final_path/config.json" "$tmpdir/config.json"
cp -a "$final_path/.sequelizerc" "$tmpdir/.sequelizerc"
#cp -a "$final_path/config.json" "$tmpdir/config.json"
#cp -a "$final_path/.sequelizerc" "$tmpdir/.sequelizerc"
# Remove the app directory securely
ynh_secure_remove --file=$final_path
#ynh_secure_remove --file=$final_path
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir=$final_path
ynh_setup_source --dest_dir=$final_path --keep="$final_path/config.json $final_path/.sequelizerc"
#Copy the admin saved settings from tmp directory to final path
cp -a "$tmpdir/config.json" "$final_path/config.json"
cp -a "$tmpdir/.sequelizerc" "$final_path/.sequelizerc"
#cp -a "$tmpdir/config.json" "$final_path/config.json"
#cp -a "$tmpdir/.sequelizerc" "$final_path/.sequelizerc"
# Remove the tmp directory securely
ynh_secure_remove --file="$tmpdir"
#ynh_secure_remove --file="$tmpdir"
fi
chmod 750 "$final_path"