2018-06-27 14:33:18 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
BASE_CONFIG="base"
|
|
|
|
CONFIG_SUFFIX=".yaml"
|
|
|
|
|
2018-08-19 18:29:34 +00:00
|
|
|
META_DIR="meta"
|
2021-01-27 20:40:04 +00:00
|
|
|
CONFIG_DIR="tasks"
|
2018-06-27 14:33:18 +00:00
|
|
|
PROFILES_DIR="profiles"
|
|
|
|
|
2020-08-09 15:28:11 +00:00
|
|
|
DOTBOT_DIR="dotbot"
|
2018-06-27 14:33:18 +00:00
|
|
|
DOTBOT_BIN="bin/dotbot"
|
|
|
|
|
|
|
|
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
|
|
|
|
|
|
|
|
cd "${BASE_DIR}"
|
2023-04-05 08:45:01 +00:00
|
|
|
git submodule update --init
|
2018-06-27 14:33:18 +00:00
|
|
|
|
|
|
|
|
|
|
|
while IFS= read -r config; do
|
|
|
|
CONFIGS+=" ${config}"
|
|
|
|
done < "${META_DIR}/${PROFILES_DIR}/$1"
|
|
|
|
|
|
|
|
shift
|
|
|
|
|
|
|
|
|
2020-08-09 15:28:11 +00:00
|
|
|
"${BASE_DIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASE_DIR}" -c "${META_DIR}/${BASE_CONFIG}${CONFIG_SUFFIX}"
|
2018-06-27 14:33:18 +00:00
|
|
|
|
|
|
|
for config in ${CONFIGS} ${@}; do
|
|
|
|
echo -e "\nConfigure $config"
|
|
|
|
configContent="$(<"${BASE_DIR}/${META_DIR}/${BASE_CONFIG}${CONFIG_SUFFIX}")\n$(<"${BASE_DIR}/${META_DIR}/${CONFIG_DIR}/${config}${CONFIG_SUFFIX}")"
|
2020-08-09 15:28:11 +00:00
|
|
|
"${BASE_DIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASE_DIR}" -c <(echo -e "$configContent")
|
2018-06-27 14:33:18 +00:00
|
|
|
done
|