-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall
executable file
·42 lines (32 loc) · 903 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
#!/usr/bin/env bash
set -e
# Determine configurations to apply
DEFAULT_CONFIG="install.conf.yaml"
CONFIGS=()
ARGS=()
for arg in "$@"; do
case $arg in
conf*) CONFIGS+=("install.conf.yaml") ;;
package*) CONFIGS+=("packages.conf.yaml") ;;
all) CONFIGS=("install.conf.yaml" "packages.conf.yaml") ;;
*) ARGS+=("$arg") ;;
esac
done
set -- "${ARGS[@]}"
[[ ${#CONFIGS[@]} -eq 0 ]] && CONFIGS+=("$DEFAULT_CONFIG")
# Init
DOTBOT_DIR="dotbot"
DOTBOT_BIN="bin/dotbot"
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "${BASEDIR}"
# Update Git submodules
git submodule sync --quiet --recursive
git submodule update --init --recursive
# Run dotbot
for config in "${CONFIGS[@]}"; do
"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" \
--plugin-dir "dotbot-plugins/*" \
-d "${BASEDIR}" \
-c "${config}" \
"${@}"
done