-
Notifications
You must be signed in to change notification settings - Fork 2
/
install
executable file
·47 lines (38 loc) · 1013 Bytes
/
install
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
#!/usr/bin/env bash
set -e
DEFAULT_CONFIG_PREFIX="default"
CONFIG_FOLDER=".dotbot-profiles"
CONFIG_SUFFIX=".yaml"
DOTBOT_DIR=".dotbot"
PLUGIN=""
PLUGIN_FOLDER=".dotbot-plugins"
DOTBOT_BIN="bin/dotbot"
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "${BASEDIR}"
git submodule update --init --recursive "${DOTBOT_DIR}"
# If the --no-default option is used omit the default config
if [ "$1" != "--no-default" ]; then
export ENV_LIST=(${DEFAULT_CONFIG_PREFIX} "${@}")
else
shift
export ENV_LIST=("${@}")
fi
for conf in "${ENV_LIST[@]}"; do
case "${conf}" in
"mac" | "mac-apps")
PLUGIN="dotbot-brew"
;;
"solus")
PLUGIN="dotbot-eopkg"
;;
"arch")
PLUGIN="dotbot-yaourt"
;;
*) ;;
esac
if [ -n "$PLUGIN" ]; then
"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" --plugin-dir "${PLUGIN_FOLDER}/${PLUGIN}" -c "${CONFIG_FOLDER}/${conf}${CONFIG_SUFFIX}"
else
"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" -c "${CONFIG_FOLDER}/${conf}${CONFIG_SUFFIX}"
fi
done