diff --git a/scripts/_common.sh b/scripts/_common.sh index 7d6bc29..1c9e8c5 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,6 @@ # COMMON VARIABLES #================================================= -#YNH_PHP_VERSION="8.2" phpversion="8.2" YNH_COMPOSER_VERSION="2.6.5" diff --git a/scripts/install b/scripts/install index 3853b44..4227f21 100755 --- a/scripts/install +++ b/scripts/install @@ -75,6 +75,13 @@ ynh_add_config --template=".env" --destination="$install_dir/.env" chmod 600 $install_dir/.env chown $app:$app $install_dir/.env +#================================================== +# FIX PHP VERSION +#================================================== +ynh_script_progression --message="Fixing php version in package.json..." --weight=1 + +ynh_replace_string --target_file="$install_dir/package.json" --match_string="php artisan lang:generate -vvv" --replace_string="php$phpversion artisan lang:generate -vvv" + #================================================= # DEPLOY #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 6a9294e..f08b1dd 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -67,6 +67,13 @@ ynh_backup_if_checksum_is_different --file="$install_dir/.env" ynh_add_config --template=".env" --destination="$install_dir/.env" +#================================================== +# FIX PHP VERSION +#================================================== +ynh_script_progression --message="Fixing php version in package.json..." --weight=1 + +ynh_replace_string --target_file="$install_dir/package.json" --match_string="php artisan lang:generate -vvv" --replace_string="php$phpversion artisan lang:generate -vvv" + #================================================= # DEPLOYMENT #=================================================