Cache last set of profiles to make upgrading easier
This commit is contained in:
parent
74e9ff464c
commit
b10a656da7
2 changed files with 12 additions and 1 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,3 +1,5 @@
|
||||||
\#*\#
|
\#*\#
|
||||||
*~
|
*~
|
||||||
*.swp
|
*.swp
|
||||||
|
|
||||||
|
.profiles
|
||||||
|
|
|
||||||
11
install
11
install
|
|
@ -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}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue