From 1befe6731778f988fcfdda56f9e66f5fd7292fe5 Mon Sep 17 00:00:00 2001 From: "Scott T. Hardin" Date: Mon, 19 Nov 2012 13:37:01 +0100 Subject: [PATCH] Add SHOESTRAP_BASE environment variable This adds SHOESTRAP_BASE to helpers/default, which allows the cookbook file to be stored separately from the rest of the shoestrap stuff, making the shoestrap directory less cluttered. For example: Old way: (cd /shoestrap && ./test1.book) New way (with cookbook moved to subdirectory 'books/'): (cd /shoestrap && SHOESTRAP_BASE=/shoestrap ./books/test1.book) --- helpers/default | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/helpers/default b/helpers/default index 2126388..bb25e5e 100644 --- a/helpers/default +++ b/helpers/default @@ -5,7 +5,11 @@ ############################################################################## COOKBOOK_NAME="$(basename $0)" -DIR="$( cd "$( dirname "$0" )" && pwd )" +if [ -z "SHOESTRAP_BASE" ]; then + DIR="$( cd "$( dirname "$0" )" && pwd )" +else + DIR="$SHOESTRAP_BASE" +fi # # Run a given recipe.