Skip to content

Commit

Permalink
Don't assume $HOME is set
Browse files Browse the repository at this point in the history
At least one IRB spec clears env before running a subprocess, and
POSIX does not require $HOME, so avoid using it if unset.
  • Loading branch information
headius committed Feb 21, 2025
1 parent 066c27e commit e4e237f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bin/jruby.sh
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,11 @@ readonly jruby_module_opts_file="$JRUBY_HOME/bin/.jruby.module_opts"

# Cascading .java_opts files for localized JVM flags
readonly installed_jruby_java_opts_file="$JRUBY_HOME/bin/.jruby.java_opts"
readonly home_jruby_java_opts_file="$HOME/.jruby.java_opts"
if [ -z "${HOME-}" ]; then
readonly home_jruby_java_opts_file=""
else
readonly home_jruby_java_opts_file="$HOME/.jruby.java_opts"
fi
readonly pwd_jruby_java_opts_file="$PWD/.jruby.java_opts"

# Options from .dev_mode.java_opts for "--dev" mode, to reduce JRuby startup time
Expand Down

0 comments on commit e4e237f

Please sign in to comment.