-
Notifications
You must be signed in to change notification settings - Fork 0
/
do
executable file
·44 lines (31 loc) · 1 KB
/
do
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
#!/usr/bin/env bash
NAMESPACE="CubicMushroom\\Slim\\OAuth2\\Server"
FILENAME="do"
COMPOSE="docker-compose"
if [ $# == 0 ];then
echo "Usage...
./${FILENAME} composer ... Run composer commands
./${FILENAME} spec ... Run PHPSpec commands
./${FILENAME} spec desc {class} Run PHPSpec desc, but will automatically include the project base namespace before the
{class} name
./${FILENAME} ... Run docker-compose ...
"
else
# If "composer" is used, pass-thru to "composer"
# inside a new container
if [ "$1" == "composer" ]; then
shift 1
${COMPOSE} run --rm composer "$@"
# If "spec" is used, run PHPSpec
elif [ "$1" == "spec" ]; then
shift 1
if [ "$1" == "desc" ]; then
shift 1
${COMPOSE} run --rm php7.1 ./vendor/bin/phpspec desc "${NAMESPACE}\\$@"
else
${COMPOSE} run --rm php7.1 ./vendor/bin/phpspec "$@"
fi
else
${COMPOSE} $@
fi
fi