Remove composer helper

This commit is contained in:
ericgaspar 2021-05-22 11:24:18 +02:00
parent 6231ad2c49
commit 11243faa80
No known key found for this signature in database
GPG key ID: 574F281483054D44
3 changed files with 6 additions and 73 deletions

View file

@ -1,15 +1,12 @@
# See here for more informations
# https://github.com/YunoHost/package_check#syntax-check_process-file
;; Test complet
; Manifest
domain="domain.tld" (DOMAIN)
path="/pterodactyl" (PATH)
is_public=1 (PUBLIC|public=1|private=0)
domain="domain.tld"
path="/pterodactyl"
is_public=1
language="fr"
password="pass"
admin="john" (USER)
port="9980" (PORT)
admin="john"
port="9980"
; Checks
pkg_linter=1
setup_sub_dir=1

View file

@ -14,7 +14,7 @@
"email": "aeris@e.email"
},
"requirements": {
"yunohost": ">= 4.1.7"
"yunohost": ">= 4.2.4"
},
"multi_instance": true,
"services": [
@ -26,29 +26,17 @@
"install": [{
"name": "domain",
"type": "domain",
"ask": {
"en": "Choose a domain name for Pterodactyl",
"fr": "Choisissez un nom de domaine pour Pterodactyl"
},
"example": "example.com"
},
{
"name": "path",
"type": "path",
"ask": {
"en": "Choose a path for Pterodactyl. For now, only /pterodactyl is accepted",
"fr": "Choisissez un chemin pour Pterodactyl. Pour l'instant seulement /pterodactyl est accepté"
},
"example": "/pterodactyl",
"default": "/pterodactyl"
},
{
"name": "admin",
"type": "user",
"ask": {
"en": "Choose an admin user (should be a YunoHost registered user)",
"fr": "Choisissez ladministrateur (should be a YunoHost registered user)"
},
"example": "johndoe"
},
{
@ -64,19 +52,11 @@
{
"name": "password",
"type": "password",
"ask": {
"en": "Set the administrator password",
"fr": "Définissez le mot de passe administrateur"
},
"example": "Choose a password"
},
{
"name": "is_public",
"type": "boolean",
"ask": {
"en": "Is it a public site?",
"fr": "Est-ce un site public ?"
},
"default": true
}

View file

@ -12,7 +12,6 @@ extra_php_dependencies="php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-gd php${
pkg_dependencies="libargon2-1 libsodium23 apt-transport-https unzip tar make gcc g++"
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
@ -20,46 +19,3 @@ pkg_dependencies="libargon2-1 libsodium23 apt-transport-https unzip tar make gcc
#=======================
# COMPOSER
#=======================
# Execute a command with Composer
#
# usage: ynh_composer_exec [--workdir=$final_path] --commands="commands"
# | arg: -w, --workdir - The directory from where the command will be executed. Default $final_path.
# | arg: -c, --commands - Commands to execute.
ynh_composer_exec () {
# Declare an array to define the options of this helper.
local legacy_args=wc
declare -Ar args_array=( [w]=workdir= [c]=commands= )
local workdir
local commands
# Manage arguments with getopts
ynh_handle_getopts_args "$@"
workdir="${workdir:-$final_path}"
COMPOSER_HOME="$workdir/.composer" \
php "$workdir/composer.phar" $commands \
-d "$workdir" --quiet --no-interaction
}
# Install and initialize Composer in the given directory
#
# usage: ynh_install_composer [--workdir=$final_path]
# | arg: -w, --workdir - The directory from where the command will be executed. Default $final_path.
ynh_install_composer () {
# Declare an array to define the options of this helper.
local legacy_args=w
declare -Ar args_array=( [w]=workdir= )
local workdir
# Manage arguments with getopts
ynh_handle_getopts_args "$@"
workdir="${workdir:-$final_path}"
curl -sS https://getcomposer.org/installer \
| COMPOSER_HOME="$workdir/.composer" \
php -- --quiet --install-dir="$workdir" \
|| ynh_die "Unable to install Composer."
# update dependencies to create composer.lock
ynh_composer_exec --workdir="$workdir" --commands="install --no-dev" \
|| ynh_die "Unable to update core dependencies with Composer."
}