Skip to content

Commit 114ba5a

Browse files
committed
make sure it works for jruby as well
1 parent 1ee8899 commit 114ba5a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

rb/.envrc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ if command -v rbenv >/dev/null 2>&1; then
66

77
RBENV_ROOT_DEFAULT="$(rbenv root 2>/dev/null || echo "$HOME/.rbenv")"
88
RUBY_SYMLINK="${RBENV_ROOT_DEFAULT}/versions/${LABEL}"
9-
RUBY_BIN="${RUBY_SYMLINK}/bin/ruby"
9+
BIN_DIR="${RUBY_SYMLINK}/bin"
1010

11-
# Always track the binary, even if missing now
12-
watch_file "${RUBY_BIN}"
11+
# Always track the directory, even if missing now
12+
watch_file "${BIN_DIR}"
1313

14-
# Only set environment variable if active
15-
if [ -x "${RUBY_BIN}" ]; then
14+
# Only set environment variable if directory currently present
15+
if [ -d "${BIN_DIR}" ]; then
1616
export RBENV_VERSION="${LABEL}"
1717
fi
1818
fi

0 commit comments

Comments
 (0)