From cc20e3ee60224e7d700511d6eaaceec2c9da7d0e Mon Sep 17 00:00:00 2001 From: Jeff LANCE Date: Wed, 12 Apr 2023 15:39:33 +0200 Subject: [PATCH] up confs --- install-profile.bak | 35 +++++++++++++++++++++++++++++++++++ install-standalone.bak | 28 ++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100755 install-profile.bak create mode 100755 install-standalone.bak diff --git a/install-profile.bak b/install-profile.bak new file mode 100755 index 0000000..e550208 --- /dev/null +++ b/install-profile.bak @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +set -e + +BASE_CONFIG="base" +CONFIG_SUFFIX=".yaml" + +META_DIR="meta" +CONFIG_DIR="tasks" +PROFILES_DIR="profiles" + +DOTBOT_DIR="dotbot" +DOTBOT_BIN="bin/dotbot" + +BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + + +cd "${BASE_DIR}" +git submodule update --init + + +while IFS= read -r config; do + CONFIGS+=" ${config}" +done < "${META_DIR}/${PROFILES_DIR}/$1" + +shift + + +"${BASE_DIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASE_DIR}" -c "${META_DIR}/${BASE_CONFIG}${CONFIG_SUFFIX}" + +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}")" + "${BASE_DIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASE_DIR}" -c <(echo -e "$configContent") +done diff --git a/install-standalone.bak b/install-standalone.bak new file mode 100755 index 0000000..90431c0 --- /dev/null +++ b/install-standalone.bak @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +set -e + +BASE_CONFIG="base" +CONFIG_SUFFIX=".yaml" + +META_DIR="meta" +CONFIG_DIR="tasks" +PROFILES_DIR="profiles" + +DOTBOT_DIR="dotbot" +DOTBOT_BIN="bin/dotbot" + +BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + + +cd "${BASE_DIR}" +git submodule update --init +# git submodule update --recursive --remote + + +"${BASE_DIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASE_DIR}" -c "${META_DIR}/${BASE_CONFIG}${CONFIG_SUFFIX}" + +for config in ${@}; do + configContent="$(<"${BASE_DIR}/${META_DIR}/${BASE_CONFIG}${CONFIG_SUFFIX}")\n$(<"${BASE_DIR}/${META_DIR}/${CONFIG_DIR}/${config}${CONFIG_SUFFIX}")" + "${BASE_DIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASE_DIR}" -c <(echo -e "$configContent") +done