mirror of
https://github.com/YunoHost-Apps/phpmyadmin_ynh.git
synced 2024-09-03 19:56:46 +02:00
commit
d7bc1f6c1c
3 changed files with 54 additions and 2 deletions
32
scripts/_common.sh
Normal file
32
scripts/_common.sh
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# COMPOSER
|
||||||
|
# =============================================================================
|
||||||
|
|
||||||
|
# Execute a composer command from a given directory
|
||||||
|
# usage: composer_exec workdir COMMAND [ARG ...]
|
||||||
|
exec_composer() {
|
||||||
|
local workdir=$1
|
||||||
|
shift 1
|
||||||
|
|
||||||
|
COMPOSER_HOME="${workdir}/.composer" \
|
||||||
|
php "${workdir}/composer.phar" $@ \
|
||||||
|
-d "${workdir}" --quiet --no-interaction
|
||||||
|
}
|
||||||
|
|
||||||
|
# Install and initialize Composer in the given directory
|
||||||
|
# usage: init_composer destdir
|
||||||
|
init_composer() {
|
||||||
|
local destdir=$1
|
||||||
|
|
||||||
|
# install composer
|
||||||
|
curl -sS https://getcomposer.org/installer \
|
||||||
|
| COMPOSER_HOME="${destdir}/.composer" \
|
||||||
|
php -- --quiet --install-dir="$destdir" \
|
||||||
|
|| ynh_die "Unable to install Composer"
|
||||||
|
|
||||||
|
# update dependencies to create composer.lock
|
||||||
|
exec_composer "$destdir" install --no-dev \
|
||||||
|
|| ynh_die "Unable to update Roundcube core dependencies"
|
||||||
|
}
|
|
@ -6,7 +6,7 @@
|
||||||
# IMPORT GENERIC HELPERS
|
# IMPORT GENERIC HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -114,6 +114,16 @@ cp ../conf/config.inc.php $final_path
|
||||||
# Recalculate and store the config file checksum into the app settings
|
# Recalculate and store the config file checksum into the app settings
|
||||||
ynh_store_file_checksum "$final_path/config.inc.php"
|
ynh_store_file_checksum "$final_path/config.inc.php"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# INSTALL DEPENDENCIES
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
# Install composer
|
||||||
|
init_composer "$final_path"
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
exec_composer "$final_path" update --no-dev
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
# IMPORT GENERIC HELPERS
|
# IMPORT GENERIC HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -130,6 +130,16 @@ cp ../conf/config.inc.php $final_path
|
||||||
# Recalculate and store the config file checksum into the app settings
|
# Recalculate and store the config file checksum into the app settings
|
||||||
ynh_store_file_checksum "$final_path/config.inc.php"
|
ynh_store_file_checksum "$final_path/config.inc.php"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# INSTALL DEPENDENCIES
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
# Install composer
|
||||||
|
init_composer "$final_path"
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
exec_composer "$final_path" update --no-dev
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue