dotfiles/install-standalone

46 lines
1.3 KiB
Plaintext
Raw Permalink Normal View History

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-12 13:38:30 +00:00
git submodule update --init --recursive --remote
2018-06-27 14:33:18 +00:00
for config in ${@}; do
2023-04-12 13:38:30 +00:00
# create temporary file
configFile="$(mktemp)"
suffix="-sudo"
echo -e "$(<"${BASE_DIR}/${META_DIR}/${BASE_CONFIG}${CONFIG_SUFFIX}")\n$(<"${BASE_DIR}/${META_DIR}/${CONFIG_DIR}/${config%"$suffix"}${CONFIG_SUFFIX}")" > "$configFile"
# cmd=("${BASE_DIR}/${META_DIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASE_DIR}" \
# -p "${BASE_DIR}/${META_DIR}/dotbot-yay/yay.py" -c "$configFile")
cmd=("${BASE_DIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASE_DIR}" \
2023-08-02 18:36:18 +00:00
-p "${BASE_DIR}/dotbot_plugins/dotbot-if/if.py" \
2023-05-09 18:02:21 +00:00
-p "${BASE_DIR}/dotbot_plugins/dotbot-apt-get/aptget.py" \
2023-05-09 20:07:19 +00:00
-p "${BASE_DIR}/dotbot_plugins/dotbot-conditional/conditional.py" \
2023-05-09 18:02:21 +00:00
-p "${BASE_DIR}/dotbot_plugins/dotbot-pamac/pamac.py" \
-p "${BASE_DIR}/dotbot_plugins/dotbot-yay/yay.py" \
-c "$configFile")
2023-04-12 13:38:30 +00:00
if [[ $config == *"sudo"* ]]; then
cmd=(sudo "${cmd[@]}")
fi
"${cmd[@]}"
rm -f "$configFile"
2018-06-27 14:33:18 +00:00
done
2023-04-12 13:38:30 +00:00
cd "${BASE_DIR}"