-
Notifications
You must be signed in to change notification settings - Fork 186
/
dg
executable file
·59 lines (53 loc) · 1.7 KB
/
dg
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
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env bash
# @TODO this file is getting huge, break it up into smaller scripts.
# Globals
APP_MODULES_DIRECTORY="modules"
APP_MODULES_CONTRIB_DIRECTORY="$APP_MODULES_DIRECTORY/contrib"
APP_MODULES_CUSTOM_DIRECTORY="$APP_MODULES_DIRECTORY/custom"
APP_THEMES_DIRECTORY="themes"
APP_BACKUPS_DIRECTORY="$HOME/drupalgap-backups"
DRUPALGAP_JS_URL="https://raw.githubusercontent.com/signalpoint/DrupalGap/8.x-1.x/drupalgap.js"
DRUPALGAP_MIN_JS_URL="https://raw.githubusercontent.com/signalpoint/DrupalGap/8.x-1.x/drupalgap.min.js"
JDRUPAL_MIN_JS_URL="https://raw.githubusercontent.com/signalpoint/jDrupal/8.x-1.x/jdrupal.min.js"
# Export the globals so they can be shared in other scripts.
export APP_MODULES_DIRECTORY
export APP_MODULES_CONTRIB_DIRECTORY
export APP_MODULES_CUSTOM_DIRECTORY
export APP_THEMES_DIRECTORY
export APP_BACKUPS_DIRECTORY
export DRUPALGAP_JS_URL
export DRUPALGAP_MIN_JS_URL
export JDRUPAL_MIN_JS_URL
# ...
# Check for an input argument command, let them know it is ready if they
# didn't supply one.
if [ -z "$1" ]
then
echo "The DrupalGap CLI is ready!"
exit 1
fi
# Determine the command and call its handler.
case "$1" in
create)
case "$2" in
module)
(. ./scripts/dg/_init.sh $@ && ./scripts/dg/create-module.sh $@)
;;
theme)
(. ./scripts/dg/_init.sh $@ && ./scripts/dg/create-theme.sh $@)
;;
esac
;;
disable|dis)
(. ./scripts/dg/_init.sh $@ && ./scripts/dg/disable.sh $@)
;;
download|dl) ./scripts/dg/download.sh $@ ;;
enable|en)
(. ./scripts/dg/_init.sh $@ && ./scripts/dg/enable.sh $@)
;;
install)
(. ./scripts/dg/_init.sh $@ && ./scripts/dg/install.sh $@)
;;
update|up) ./scripts/dg/update.sh $@ ;;
-*) usage "Unknown command: $1";;
esac