-
Notifications
You must be signed in to change notification settings - Fork 0
/
run
executable file
·49 lines (37 loc) · 1.43 KB
/
run
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
#!/usr/bin/env bash
# Default environment.
export DEV_LIB_PATH=dev-lib
export WORDPOINTS_PROJECT_TYPE=extension
# This file is used to override the above defaults.
if [ -e .wordpoints-dev-lib-config.sh ]; then
source .wordpoints-dev-lib-config.sh
fi
# Load the rest of the environment.
source "$DEV_LIB_PATH"/bin/env.sh
# Load the functions.
source "$DEV_LIB_PATH"/bin/functions.sh
# Allow config vars and functions to be overridden.
if [ "$(declare -f wordpoints-dev-lib-config )" ]; then
# Back up the base path.
BACKUP_CODESNIFF_PATH=$CODESNIFF_PATH
wordpoints-dev-lib-config
# If it was modified, make sure that this path is updated as well. This assumes
# that something was added to it, and nothing removed from it. We do this for
# back-compat.
if [[ ${#CODESNIFF_PATH} != ${#BACKUP_CODESNIFF_PATH} ]]; then
CODESNIFF_PATH_PHP+=${BACKUP_CODESNIFF_PATH[@]:${#CODESNIFF_PATH[@]}}
CODESNIFF_PATH_PHP_AUTOLOADERS+=${BACKUP_CODESNIFF_PATH[@]:${#CODESNIFF_PATH[@]}}
CODESNIFF_PATH_XML+=${BACKUP_CODESNIFF_PATH[@]:${#CODESNIFF_PATH[@]}}
CODESNIFF_PATH_BASH+=${BACKUP_CODESNIFF_PATH[@]:${#CODESNIFF_PATH[@]}}
if [ -z ${CODESNIFF_PATH_PHP_SYNTAX} ]; then
CODESNIFF_PATH_PHP_SYNTAX+=${BACKUP_CODESNIFF_PATH[@]:${#CODESNIFF_PATH[@]}}
fi
fi
fi
# If this command is handled by a function, call it. Otherwise, source the file.
if [ "$(declare -f wpdl-$1 )" ]; then
"wpdl-$1" "${@:2}"
else
source "$DEV_LIB_PATH"/bin/"$1".sh
fi
# EOF