-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix iterating through paths that have spaces in them
- Loading branch information
Showing
8 changed files
with
51 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,8 @@ fi | |
RBENV_COMMAND_PATH="$(rbenv-which "$RBENV_COMMAND")" | ||
RBENV_BIN_PATH="${RBENV_COMMAND_PATH%/*}" | ||
|
||
for script in $(rbenv-hooks exec); do | ||
IFS=$'\n' scripts=(`rbenv-hooks exec`) | ||
for script in "${scripts[@]}"; do | ||
source "$script" | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
sstephenson
Contributor
|
||
done | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bats | ||
|
||
load test_helper | ||
|
||
@test "supports hook path with spaces" { | ||
hook_path="${RBENV_TEST_DIR}/custom stuff/rbenv hooks" | ||
mkdir -p "${hook_path}/exec" | ||
echo "export HELLO='from hook'" > "${hook_path}/exec/hello.bash" | ||
|
||
export RBENV_VERSION=system | ||
RBENV_HOOK_PATH="$hook_path" run rbenv-exec env | ||
assert_success | ||
assert_line "HELLO=from hook" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Because scripts are sourced, IFS must be set back to default value, otherwise all the scripts have to set IFS explicitly.