1
0
Fork 0

Cache last set of profiles to make upgrading easier

This commit is contained in:
Jeremy Kaplan 2020-01-06 22:24:33 -08:00
commit b10a656da7
2 changed files with 12 additions and 1 deletions

2
.gitignore vendored
View file

@ -1,3 +1,5 @@
\#*\# \#*\#
*~ *~
*.swp *.swp
.profiles

11
install
View file

@ -8,6 +8,7 @@ DOTBOT_DIR="dotbot"
DOTBOT_BIN="bin/dotbot" DOTBOT_BIN="bin/dotbot"
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROFILES_FILE="${BASEDIR}/.profiles"
cd "${BASEDIR}" cd "${BASEDIR}"
git submodule update --init --recursive "${DOTBOT_DIR}" git submodule update --init --recursive "${DOTBOT_DIR}"
@ -23,6 +24,14 @@ load_config() {
OS_NAME="$(uname -s | tr '[:upper:]' '[:lower:]')" OS_NAME="$(uname -s | tr '[:upper:]' '[:lower:]')"
for conf in default ${@} "${OS_NAME}"; do if [ -f "${PROFILES_FILE}" ]; then
mapfile -t profiles < "${PROFILES_FILE}"
else
profiles=("${@}")
fi
for conf in default "${OS_NAME}" "${profiles[@]}"; do
load_config "${conf}${CONFIG_SUFFIX}" load_config "${conf}${CONFIG_SUFFIX}"
done done
printf "%s\n" "${profiles[@]}" > "${PROFILES_FILE}"