Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Paste
P298
/usr/local/bin/run-php-script
Active
Public
Actions
Authored by
dereckson
on Feb 8 2022, 17:02.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Referenced Files
F1691043: /usr/local/bin/run-php-script
Feb 8 2022, 17:02
2022-02-08 17:02:27 (UTC+0)
Subscribers
None
#!/bin/sh
COMMAND
=
$1
shift
if
[
-f vendor/bin/
$COMMAND
]
;
then
echo
"Switching to Composer
$COMMAND
:"
SCRIPT
=
vendor/bin/
$COMMAND
elif
[
-f /opt/
$COMMAND
.phar
]
;
then
SCRIPT
=
/opt/
$COMMAND
.phar
else
SCRIPT
=
$(
which
$COMMAND
)
2
> /dev/null
if
[
$?
-ne
0
]
;
then
echo
"No
$COMMAND
has been found."
exit
1
fi
fi
php
$SCRIPT
"
$@
"
Event Timeline
dereckson
created this paste.
Feb 8 2022, 17:02
2022-02-08 17:02:27 (UTC+0)
Log In to Comment