diff --git a/scripts/install b/scripts/install index 33d3013..11f2536 100755 --- a/scripts/install +++ b/scripts/install @@ -102,7 +102,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) ynh_script_progression --message="Installing Lychee with Composer..." --weight=15 # Install composer -ynh_install_composer --phpversion="${YNH_PHP_VERSION}" --workdir="$final_path" --install_args="--prefer-source --no-dev" +ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" --install_args="--prefer-source --no-dev" #================================================= # BUILDING @@ -117,10 +117,12 @@ ynh_replace_string --match_string="__DB_PASS__" --replace_string="$db_pwd" --tar ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/.env" # setup application config -cd $final_path && php$phpversion artisan key:generate -n --force --env -cd $final_path && php$phpversion artisan migrate -n --force -cd $final_path && php$phpversion artisan config:clear -n -cd $final_path && php$phpversion artisan config:cache -n +pushd $final_path + hp$phpversion artisan key:generate -n --force --env + php$phpversion artisan migrate -n --force + php$phpversion artisan config:clear -n + php$phpversion artisan config:cache -n +popd #================================================= # STORE THE CONFIG FILE CHECKSUM diff --git a/scripts/upgrade b/scripts/upgrade index 9068e54..6deb4bd 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -117,7 +117,9 @@ ynh_script_progression --message="Installing Composer..." --weight=10 ynh_install_composer --phpversion="${YNH_PHP_VERSION}" --workdir="$final_path" --install_args="--prefer-source --no-dev" -cd $final_path && php$phpversion artisan migrate -n --force +pushd $final_path + php$phpversion artisan migrate #-n --force +popd ynh_backup_if_checksum_is_different --file="$final_path/.env" # Recalculate and store the checksum of the file for the next upgrade.