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)
This commit is contained in:
Scott T. Hardin 2012-11-19 13:37:01 +01:00
parent dfab18817e
commit 1befe67317

View File

@ -5,7 +5,11 @@
############################################################################## ##############################################################################
COOKBOOK_NAME="$(basename $0)" 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. # Run a given recipe.