From d07d3834f0318ccbdbada2f305cc346ebb9d6f73 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 12 May 2021 12:11:58 +0200 Subject: [PATCH] ynh_exec_as --- scripts/install | 2 +- scripts/upgrade | 15 ++++----------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/scripts/install b/scripts/install index 90d0eea..43a0751 100644 --- a/scripts/install +++ b/scripts/install @@ -149,7 +149,7 @@ ynh_add_config --template="../conf/configuration.yml" --destination="$final_path # Execute post-installation pushd $final_path - exec_as $app php$phpversion -d $final_path -d memory_limit=-1 flarum install -f configuration.yml + ynh_exec_as $app php$phpversion -d $final_path -d memory_limit=-1 flarum install -f configuration.yml # Delete configuration.yml as it contains sensitive data ynh_secure_remove --file="$final_path/configuration.yml" popd diff --git a/scripts/upgrade b/scripts/upgrade index 396be85..6b83ef9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -140,13 +140,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated nginx config ynh_add_nginx_config -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=2 - -ynh_install_app_dependencies $pkg_dependencies - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -184,8 +177,8 @@ then ynh_script_progression --message="Upgrading Flarum and its extensions..." --weight=1 ynh_exec_warn_less ynh_composer_exec --phpversion=$phpversion --workdir=$final_path --commands=\"require tituspijean/flarum-ext-auth-ldap:$ldap_version --no-update\" ynh_exec_warn_less ynh_composer_exec --phpversion=$phpversion --workdir=$final_path --commands=\"require flarum/core:$core_version --prefer-dist --update-no-dev -a --update-with-all-dependencies\" - exec_as $app php$phpversion flarum migrate - exec_as $app php$phpversion flarum cache:clear + ynh_exec_as $app php$phpversion flarum migrate + ynh_exec_as $app php$phpversion flarum cache:clear popd fi @@ -193,7 +186,7 @@ fi # FLARUM EXTENSIONS #================================================= -if ! exec_as $app php$phpversion flarum info | grep -q "tituspijean-auth-ldap" | grep -q $ldap_version; +if ! ynh_exec_as $app php$phpversion flarum info | grep -q "tituspijean-auth-ldap" | grep -q $ldap_version; then # Install and activate the LDAP auth extension activate_flarum_extension $db_name "tituspijean-auth-ldap" @@ -223,7 +216,7 @@ ynh_print_info "You may need to manually enable your language extension in Flaru # Clear cache pushd $final_path - exec_as $app php$phpversion flarum cache:clear + ynh_exec_as $app php$phpversion flarum cache:clear popd # Save version settings