Merge pull request #986 from jeffkowalski/fix_init

Prefer 'set' over 'setenv' for fish shell
This commit is contained in:
Mislav Marohnić 2017-05-17 00:34:20 +02:00 committed by GitHub
commit 755c820724
2 changed files with 4 additions and 4 deletions

View file

@ -86,8 +86,8 @@ mkdir -p "${RBENV_ROOT}/"{shims,versions}
case "$shell" in
fish )
echo "setenv PATH '${RBENV_ROOT}/shims' \$PATH"
echo "setenv RBENV_SHELL $shell"
echo "set -gx PATH '${RBENV_ROOT}/shims' \$PATH"
echo "set -gx RBENV_SHELL $shell"
;;
* )
echo 'export PATH="'${RBENV_ROOT}'/shims:${PATH}"'

4
test/init.bats Normal file → Executable file
View file

@ -73,7 +73,7 @@ OUT
export PATH="${BATS_TEST_DIRNAME}/../libexec:/usr/bin:/bin:/usr/local/bin"
run rbenv-init - fish
assert_success
assert_line 0 "setenv PATH '${RBENV_ROOT}/shims' \$PATH"
assert_line 0 "set -gx PATH '${RBENV_ROOT}/shims' \$PATH"
}
@test "can add shims to PATH more than once" {
@ -87,7 +87,7 @@ OUT
export PATH="${RBENV_ROOT}/shims:$PATH"
run rbenv-init - fish
assert_success
assert_line 0 "setenv PATH '${RBENV_ROOT}/shims' \$PATH"
assert_line 0 "set -gx PATH '${RBENV_ROOT}/shims' \$PATH"
}
@test "outputs sh-compatible syntax" {