diff --git a/scripts/_common.sh b/scripts/_common.sh index 15d8b53..653158f 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -44,6 +44,12 @@ function set_permissions { chmod -R g=u,g-w,o-rwx "$data_path" } +function setup_sources { + ynh_secure_remove "$final_path" + ynh_setup_source --dest_dir="$final_path" + mkdir -p "$data_path" +} + #================================================= # EXPERIMENTAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index b27f7ae..eaef17c 100755 --- a/scripts/install +++ b/scripts/install @@ -76,11 +76,9 @@ ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ st ynh_script_progression --message="Setting up source files..." --weight=5 ynh_app_setting_set --app=$app --key=final_path --value=$final_path -# Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" - ynh_app_setting_set --app=$app --key=data_path --value=$data_path -mkdir -p $data_path + +setup_sources #================================================= # NGINX CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index f953ba6..d8a0eb7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -62,8 +62,7 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=5 - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" + setup_sources fi #=================================================