forked from Hasnayeen/invobook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cmd
executable file
·33 lines (31 loc) · 906 Bytes
/
cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash
COMPOSE="docker-compose"
if [ $# -gt 0 ];then
if [[ "$1" == "art" ]]; then
shift 1
$COMPOSE run --rm -w /var/www php php artisan "$@"
elif [[ "$1" == "composer" ]]; then
shift 1
$COMPOSE run --rm -w /var/www php composer "$@"
elif [[ "$1" == "test" ]]; then
shift 1
$COMPOSE run --rm -w /var/www php ./vendor/bin/phpunit "$@"
elif [[ "$1" == "npm" ]]; then
shift 1
$COMPOSE run --rm -w /var/www laravel_echo_server npm "$@"
elif [[ "$1" == "yarn" ]]; then
shift 1
$COMPOSE run --rm -w /var/www laravel_echo_server yarn "$@"
elif [[ "$1" == "mysql" ]]; then
shift 1
$COMPOSE run --rm -w / db mysql "$@"
elif [[ "$1" == "restart" ]]; then
shift 1
$COMPOSE stop
$COMPOSE start
else
$COMPOSE "$@"
fi
else
$COMPOSE ps
fi