Skip to content

Commit b4c663f

Browse files
committed
Add 'composer' to the list of cmds allowed by v-run-cli-cmd
1 parent 74116cb commit b4c663f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

bin/v-run-cli-cmd

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,12 @@ if [ -z $homedir ]; then
2424
check_result $E_NOTEXIST "Error: user home directory doesn't exist"
2525
fi
2626

27-
realcmd="$(which "$clicmd")"
28-
check_result $? "Unknown cli command" $E_NOTEXIST
27+
if [ "$clicmd" = "composer" ]; then
28+
realcmd="$homedir/.composer/composer"
29+
else
30+
realcmd="$(which "$clicmd")"
31+
check_result $? "Unknown cli command" $E_NOTEXIST
32+
fi
2933

3034
if [ ! -x "$realcmd" ]; then
3135
check_result $E_NOTEXIST "Error: Cli command does not exist"
@@ -49,7 +53,8 @@ if [ "$realcmd" != '/bin/ps' -a \
4953
"$realcmd" != '/usr/bin/php7.1' -a \
5054
"$realcmd" != '/usr/bin/php7.2' -a \
5155
"$realcmd" != '/usr/bin/php7.3' -a \
52-
"$realcmd" != '/usr/bin/php' ]; then
56+
"$realcmd" != '/usr/bin/php' -a \
57+
"$clicmd" != 'composer' ]; then
5358
check_result $E_FORBIDEN "Error: Cli command not enabled"
5459
fi
5560

0 commit comments

Comments
 (0)