From 8ddc84873aeb764381eff5136e6244e2f9f1f486 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 12 Mar 2021 22:53:24 +0100 Subject: [PATCH] Cleanup --- scripts/ynh_install_php | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/scripts/ynh_install_php b/scripts/ynh_install_php index bdd0b57..31015fa 100644 --- a/scripts/ynh_install_php +++ b/scripts/ynh_install_php @@ -176,21 +176,6 @@ ynh_install_php () { git clone -q https://github.com/madumlao/phpenv-aliases.git "${phpenv_install_dir}/plugins/phpenv-aliase" fi - php_composer="$(command -v "$phpenv_install_dir"/plugins/*/libexec/composer composer | head -1)" - if [ -n "$php_composer" ]; then - ynh_print_info --message="\`composer' command already available in \`$php_composer'." - pushd "${php_composer%/*/*}" - if git remote -v 2>/dev/null | grep -q phpenv-composer; then - ynh_print_info --message="Trying to update phpenv-composer with git..." - git pull -q origin master - fi - popd - else - ynh_print_info --message="Installing phpenv-composer with git..." - mkdir -p "${phpenv_install_dir}/plugins" - git clone -q https://github.com/ngyuki/phpenv-composer.git "${phpenv_install_dir}/plugins/phpenv-composer" - fi - php_latest="$(command -v "$phpenv_install_dir"/plugins/*/bin/phpenv-latest phpenv-latest | head -1)" if [ -n "$php_latest" ]; then ynh_print_info --message="\`phpenv latest' command already available in \`$php_latest'." @@ -206,6 +191,21 @@ ynh_install_php () { git clone -q https://github.com/momo-lab/xxenv-latest.git "${phpenv_install_dir}/plugins/xxenv-latest" fi + php_composer="$(command -v "$phpenv_install_dir"/plugins/*/libexec/composer composer | head -1)" + if [ -n "$php_composer" ]; then + ynh_print_info --message="\`composer' command already available in \`$php_composer'." + pushd "${php_composer%/*/*}" + if git remote -v 2>/dev/null | grep -q phpenv-composer; then + ynh_print_info --message="Trying to update phpenv-composer with git..." + git pull -q origin master + fi + popd + else + ynh_print_info --message="Installing phpenv-composer with git..." + mkdir -p "${phpenv_install_dir}/plugins" + git clone -q https://github.com/ngyuki/phpenv-composer.git "${phpenv_install_dir}/plugins/phpenv-composer" + fi + # Enable caching mkdir -p "${phpenv_install_dir}/cache" @@ -324,7 +324,7 @@ ynh_cleanup_php () { # Remove phpenv environment configuration ynh_print_info --message="Removing of phpenv" ynh_secure_remove --file="$phpenv_install_dir" - rm /etc/profile.d/phpenv.sh + ynh_secure_remove --file="/etc/profile.d/phpenv.sh" fi }