mirror of
https://github.com/YunoHost-Apps/snipeit_ynh.git
synced 2024-09-03 20:26:16 +02:00
Fix composer
This commit is contained in:
parent
06f24f5bd5
commit
3a99f9cb6f
1 changed files with 15 additions and 0 deletions
|
@ -15,6 +15,21 @@ pkg_dependencies="openssl php-mbstring php-curl php-mysql php-ldap php-zip php-
|
||||||
# EXPERIMENTAL HELPERS
|
# EXPERIMENTAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
# Execute a command as another user
|
||||||
|
# usage: exec_as USER COMMAND [ARG ...]
|
||||||
|
exec_as() {
|
||||||
|
local USER=$1
|
||||||
|
shift 1
|
||||||
|
|
||||||
|
if [[ $USER = $(whoami) ]]; then
|
||||||
|
eval $@
|
||||||
|
else
|
||||||
|
# use sudo twice to be root and be allowed to use another user
|
||||||
|
sudo sudo -u "$USER" $@
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# Execute a composer command from a given directory
|
# Execute a composer command from a given directory
|
||||||
# usage: composer_exec AS_USER WORKDIR COMMAND [ARG ...]
|
# usage: composer_exec AS_USER WORKDIR COMMAND [ARG ...]
|
||||||
exec_composer() {
|
exec_composer() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue