Skip to content

Commit

Permalink
Fixed up Bake to always use relative bake path.
Browse files Browse the repository at this point in the history
  • Loading branch information
impwu committed Apr 12, 2018
1 parent b9b97e1 commit 5b598ac
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bake
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ BAKE_LOG_LEVEL="${BAKE_LOG_LEVEL:-$BAKE_LOG_LEVEL_INFO}"
#
# The list of directories that bake will search when resolving libraries (via require)
#
BAKEPATH="${BAKEPATH:-.}"
BAKEPATH=${BAKEPATH:+$BAKEPATH:}$PWD

BAKE_PACKAGES_PATH="$HOME/.bake/packages"

Expand Down
14 changes: 14 additions & 0 deletions test/Bakefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,20 @@ function 08_catch_failed_require () {
bake_echo_green "This is after the require, if you see this then the test failed."
}

bake_test 09_test_bakepath
function 09_test_bakepath () {
bake_echo_green "This tests that setting a Bakepath works appropriately"
BAKEPATH="$PWD/lib" ../bake 09_test_bakepath_helper
bake_echo_green "This is after the require, if you see this then the test succeeded."
}

bake_task 09_test_bakepath_helper "Called by the associated test"
function 09_test_bakepath_helper () {
bake_echo_green "This should be called with the BAKEPATH=\"$PWD\"/lib by the associated test"
bake_require lib/mylib.sh
bake_require mylib.sh
}

bake_task all
function all () {
bake_log_level fatal
Expand Down

0 comments on commit 5b598ac

Please sign in to comment.