-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·36 lines (27 loc) · 1.01 KB
/
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
#!/usr/bin/env bash
set -e
# Multi-target configuration
# Credit: https://github.com/anishathalye/dotbot/pull/11#issuecomment-73082152
DEFAULT_CONFIG_PREFIXES="default"
CONFIG_SUFFIX=".conf.yaml"
DOTBOT_DIR="dotbot"
DOTBOT_BIN="bin/dotbot"
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Detect platform/OS and set PLATFORM variable
. ${BASEDIR}/platforms/detect.sh
# Convert platform to lowercase
. ${BASEDIR}/system/function_text.sh
plat=$(tolower $PLATFORM)
# If a platform-specific install exists, then add it to the default list
if [ -f "${BASEDIR}/${plat}${CONFIG_SUFFIX}" ] ; then
DEFAULT_CONFIG_PREFIXES="${DEFAULT_CONFIG_PREFIXES} $plat"
fi
# Update all git submodules (including dotbot)
cd "${BASEDIR}"
git submodule update --init --recursive
# Don't exit the install if one of our configuration files has an error
set +e
for conf in ${DEFAULT_CONFIG_PREFIXES} ${@}; do
echo "Installing ${conf} configuration..."
"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" -c "${conf}${CONFIG_SUFFIX}"
done