-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathops.sh
More file actions
executable file
·46 lines (37 loc) · 902 Bytes
/
ops.sh
File metadata and controls
executable file
·46 lines (37 loc) · 902 Bytes
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
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
# Heavily borrowed from Cris Fidao and the "Shipping Docker" course
# https://serversforhackers.com/shipping-docker
COMPOSE="docker compose"
# If we pass any arguments...
if [ $# -gt 0 ];then
# Run the artisan console
if [ "$1" == "art" ]; then
shift 1
$COMPOSE exec \
php \
php artisan "$@"
# Run the artisan console
elif [ "$1" == "artisan" ]; then
shift 1
$COMPOSE exec \
php \
php artisan "$@"
# Run Composer
elif [ "$1" == "composer" ]; then
shift 1
$COMPOSE exec \
php \
composer "$@"
# Run NPM
elif [ "$1" == "yarn" ]; then
shift 1
$COMPOSE run --rm \
node \
yarn "$@"
# Else, pass through to docker compose
else
$COMPOSE "$@"
fi
else
$COMPOSE ps
fi