1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/movim_ynh.git synced 2024-09-03 19:46:19 +02:00
This commit is contained in:
Éric Gaspar 2024-05-13 15:43:03 +02:00
parent 46ca5fd46f
commit d5e246cabe
2 changed files with 25 additions and 1 deletions

View file

@ -10,6 +10,30 @@ YNH_COMPOSER_VERSION="2.6.5"
# PERSONAL HELPERS
#=================================================
# Requires YunoHost version 4.2 or higher.
ynh_composer_execute() {
local _globalphpversion=${phpversion-:}
# Declare an array to define the options of this helper.
local legacy_args=vwc
declare -Ar args_array=([v]=phpversion= [w]=workdir= [c]=commands=)
local phpversion
local workdir
local commands
# Manage arguments with getopts
ynh_handle_getopts_args "$@"
workdir="${workdir:-${install_dir:-$final_path}}"
if dpkg --compare-versions ${YNH_APP_PACKAGING_FORMAT:-0} lt 2; then
phpversion="${phpversion:-$YNH_PHP_VERSION}"
else
phpversion="${phpversion:-$_globalphpversion}"
fi
COMPOSER_HOME="sudo -u $app $workdir/.composer" COMPOSER_MEMORY_LIMIT=-1 \
php${phpversion} "$workdir/composer.phar" $commands \
-d "$workdir" --no-interaction --no-ansi 2>&1
}
#=================================================
# EXPERIMENTAL HELPERS
#=================================================

View file

@ -59,7 +59,7 @@ ynh_install_composer
ln -s $(which php$phpversion) $install_dir/php
PATH=$install_dir:$PATH
ynh_exec_warn_less ynh_composer_exec --commands="movim:migrate"
ynh_exec_warn_less ynh_composer_execute --commands="movim:migrate"
rm $install_dir/php
ynh_exec_as "$app" "php$phpversion" "$install_dir/daemon.php" config --username="$admin" --password="$password" --quiet