From 4d96db40eb67409447804cfd1e238b1ef26f383b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 9 Sep 2023 11:33:22 +0200 Subject: [PATCH] cleaning --- scripts/install | 11 +++++------ scripts/upgrade | 5 +---- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/scripts/install b/scripts/install index c638c92..0b7f47f 100644 --- a/scripts/install +++ b/scripts/install @@ -43,7 +43,6 @@ ynh_script_progression --message="Installing $app..." --weight=60 pushd $install_dir ynh_use_nodejs - #ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH src/bin/run.sh ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH bin/installDeps.sh popd @@ -52,10 +51,10 @@ popd #================================================= ynh_script_progression --message="Configuring $app..." --weight=6 -cp ../conf/settings.json $install_dir/settings.json +ynh_add_config --template="../conf/settings.json" --destination="$install_dir/settings.json" +chmod 400 "$install_dir/settings.json" +chown $app:$app "$install_dir/settings.json" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$install_dir/settings.json" -ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$install_dir/settings.json" if [ "$export" = "abiword" ] then # Get AbiWord binary path @@ -72,8 +71,8 @@ fi ynh_store_file_checksum --file="$install_dir/settings.json" ynh_add_config --template="../conf/credentials.json" --destination="$install_dir/credentials.json" - -chmod 400 $install_dir/credentials.json +chmod 400 "$install_dir/credentials.json" +chown $app:$app "$install_dir/credentials.json" #================================================= # SETUP SYSTEMD diff --git a/scripts/upgrade b/scripts/upgrade index f59bf9e..6614e6c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -32,7 +32,7 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --keep="$install_dir/settings.json $install_dir/credentials.json" + ynh_setup_source --dest_dir="$install_dir" --keep="settings.json credentials.json" fi chmod -R o-rwx "$install_dir" @@ -63,10 +63,7 @@ ynh_script_progression --message="Installing $app..." --weight=90 pushd $install_dir ynh_use_nodejs - #ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" src/bin/run.sh ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH bin/installDeps.sh - #ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm cache clean --force - #ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm install --upgrade popd #=================================================