From 68e85b7d14d45fc4a3e690821f8f2a6c037de7d9 Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Fri, 23 Feb 2018 10:12:24 -0500 Subject: [PATCH] [provisioning] Default to base, but don't always require it --- provision.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/provision.sh b/provision.sh index 84ce5c0..7f586cd 100755 --- a/provision.sh +++ b/provision.sh @@ -3,7 +3,8 @@ set +e RECIPE_PATH=${HOME}/dotfiles/recipes RECIPES=$(ls $RECIPE_PATH|grep -v '^_') -INSTALL=(base) +INSTALL=() +STACK=() while [[ $# -gt 0 ]]; do case $1 in @@ -46,12 +47,22 @@ function _run { } function _recipe { + STACK+=("$1") + echo "-- Recipe '${STACK[@]}' --" source ${HOME}/dotfiles/recipes/$1 + unset STACK[${#STACK[@]}-1] + echo "-- Recipe '${STACK[@]}' --" } USER=${USER:-$(whoami)} _PLATFORM=$(uname -s | awk '{print tolower($1)}') +if [ -z "${INSTALL[@]}" ]; then + INSTALL=(base) +fi + + +echo "-- Provisioning [${INSTALL[@]}] --" for recipe in "${INSTALL[@]}"; do _recipe $recipe done