Skip to content

Commit 15d261a

Browse files
authored
Merge pull request #25 from impguard/default-relative-bakepath
Fixed up Bake to always use relative bake path.
2 parents b9b97e1 + 5b598ac commit 15d261a

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

bake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ BAKE_LOG_LEVEL="${BAKE_LOG_LEVEL:-$BAKE_LOG_LEVEL_INFO}"
3434
#
3535
# The list of directories that bake will search when resolving libraries (via require)
3636
#
37-
BAKEPATH="${BAKEPATH:-.}"
37+
BAKEPATH=${BAKEPATH:+$BAKEPATH:}$PWD
3838

3939
BAKE_PACKAGES_PATH="$HOME/.bake/packages"
4040

test/Bakefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,20 @@ function 08_catch_failed_require () {
121121
bake_echo_green "This is after the require, if you see this then the test failed."
122122
}
123123

124+
bake_test 09_test_bakepath
125+
function 09_test_bakepath () {
126+
bake_echo_green "This tests that setting a Bakepath works appropriately"
127+
BAKEPATH="$PWD/lib" ../bake 09_test_bakepath_helper
128+
bake_echo_green "This is after the require, if you see this then the test succeeded."
129+
}
130+
131+
bake_task 09_test_bakepath_helper "Called by the associated test"
132+
function 09_test_bakepath_helper () {
133+
bake_echo_green "This should be called with the BAKEPATH=\"$PWD\"/lib by the associated test"
134+
bake_require lib/mylib.sh
135+
bake_require mylib.sh
136+
}
137+
124138
bake_task all
125139
function all () {
126140
bake_log_level fatal

0 commit comments

Comments
 (0)