1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/roundcube_ynh.git synced 2024-09-03 20:16:28 +02:00

[fix] add sudo for exec_as function & delete sudo or exec_composer

This commit is contained in:
magikcypress 2017-06-17 18:11:38 +02:00
parent 1a0ebf97ff
commit 6a7631aaaf
No known key found for this signature in database
GPG key ID: 3B3C7CD61957AC9A

View file

@ -55,7 +55,7 @@ exec_as() {
eval $@
else
# use sudo twice to be root and be allowed to use another user
sudo -u "$USER" $@
sudo sudo -u "$USER" $@
fi
}
@ -67,7 +67,7 @@ exec_composer() {
shift 2
exec_as "$AS_USER" COMPOSER_HOME="${WORKDIR}/.composer" \
sudo php "${WORKDIR}/composer.phar" $@ \
php "${WORKDIR}/composer.phar" $@ \
-d "${WORKDIR}" --quiet --no-interaction
}
@ -78,7 +78,7 @@ init_composer() {
local AS_USER=${2:-admin}
# install composer
sudo curl -sS https://getcomposer.org/installer \
curl -sS https://getcomposer.org/installer \
| exec_as "$AS_USER" COMPOSER_HOME="${DESTDIR}/.composer" \
php -- --quiet --install-dir="$DESTDIR" \
|| ynh_die "Unable to install Composer"