Merge pull request #1586 from ericgaspar/dev

Fix composer workdir variable for package v2
This commit is contained in:
Alexandre Aubin 2023-02-06 17:48:40 +01:00 committed by GitHub
commit add0dbb864
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 17 deletions

View file

@ -499,9 +499,9 @@ ynh_composer_exec() {
# Install and initialize Composer in the given directory
#
# usage: ynh_install_composer [--phpversion=phpversion] [--workdir=$final_path] [--install_args="--optimize-autoloader"] [--composerversion=composerversion]
# usage: ynh_install_composer [--phpversion=phpversion] [--workdir=$install_dir] [--install_args="--optimize-autoloader"] [--composerversion=composerversion]
# | arg: -v, --phpversion - PHP version to use with composer
# | arg: -w, --workdir - The directory from where the command will be executed. Default $final_path.
# | arg: -w, --workdir - The directory from where the command will be executed. Default $install_dir.
# | arg: -a, --install_args - Additional arguments provided to the composer install. Argument --no-dev already include
# | arg: -c, --composerversion - Composer version to install
#
@ -516,7 +516,11 @@ ynh_install_composer() {
local composerversion
# Manage arguments with getopts
ynh_handle_getopts_args "$@"
if dpkg --compare-versions ${YNH_APP_PACKAGING_FORMAT:-0} lt 2; then
workdir="${workdir:-$final_path}"
else
workdir="${workdir:-$install_dir}"
fi
phpversion="${phpversion:-$YNH_PHP_VERSION}"
install_args="${install_args:-}"
composerversion="${composerversion:-$YNH_COMPOSER_VERSION}"

View file

@ -222,7 +222,7 @@ ynh_abort_if_errors
)
else:
# FIXME: currently in app install code, we have
# more sophisticated code checking if this broke something on the system etc ...
# more sophisticated code checking if this broke something on the system etc.
# dunno if we want to do this here or manage it elsewhere
pass
@ -773,6 +773,7 @@ class PortsResource(AppResource):
[resources.ports]
# (empty should be fine for most apps... though you can customize stuff if absolutely needed)
main.default = 12345 # if you really want to specify a prefered value .. but shouldnt matter in the majority of cases
xmpp_client.default = 5222 # if you need another port, pick a name for it (here, "xmpp_client")