mirror of
https://github.com/correl/dotfiles.git
synced 2024-12-18 11:06:17 +00:00
[provisioning] Default to base, but don't always require it
This commit is contained in:
parent
ceb514c1e2
commit
68e85b7d14
1 changed files with 12 additions and 1 deletions
13
provision.sh
13
provision.sh
|
@ -3,7 +3,8 @@ set +e
|
||||||
|
|
||||||
RECIPE_PATH=${HOME}/dotfiles/recipes
|
RECIPE_PATH=${HOME}/dotfiles/recipes
|
||||||
RECIPES=$(ls $RECIPE_PATH|grep -v '^_')
|
RECIPES=$(ls $RECIPE_PATH|grep -v '^_')
|
||||||
INSTALL=(base)
|
INSTALL=()
|
||||||
|
STACK=()
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
|
@ -46,12 +47,22 @@ function _run {
|
||||||
}
|
}
|
||||||
|
|
||||||
function _recipe {
|
function _recipe {
|
||||||
|
STACK+=("$1")
|
||||||
|
echo "-- Recipe '${STACK[@]}' --"
|
||||||
source ${HOME}/dotfiles/recipes/$1
|
source ${HOME}/dotfiles/recipes/$1
|
||||||
|
unset STACK[${#STACK[@]}-1]
|
||||||
|
echo "-- Recipe '${STACK[@]}' --"
|
||||||
}
|
}
|
||||||
|
|
||||||
USER=${USER:-$(whoami)}
|
USER=${USER:-$(whoami)}
|
||||||
_PLATFORM=$(uname -s | awk '{print tolower($1)}')
|
_PLATFORM=$(uname -s | awk '{print tolower($1)}')
|
||||||
|
|
||||||
|
if [ -z "${INSTALL[@]}" ]; then
|
||||||
|
INSTALL=(base)
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
echo "-- Provisioning [${INSTALL[@]}] --"
|
||||||
for recipe in "${INSTALL[@]}"; do
|
for recipe in "${INSTALL[@]}"; do
|
||||||
_recipe $recipe
|
_recipe $recipe
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue