File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,16 @@ function export_stdlib_path
2222 set -l current_dir (pwd )
2323
2424 set -l which_elixir_expr $argv [1]
25- set -gx ELX_STDLIB_PATH (readlink_f (eval $which_elixir_expr ) | string replace -r ' (.*)\ /bin\ /elixir' ' $1' )
25+ # Separate evaluation from readlink_f call to avoid infinite loop
26+ # when elixir is not found
27+ set -l stdlib_path (eval $which_elixir_expr 2> /dev/null)
28+
29+ # Only proceed if elixir was found
30+ if test -n " $stdlib_path "
31+ set -l stdlib_real_path (readlink_f " $stdlib_path " )
32+ set -gx ELX_STDLIB_PATH (echo $stdlib_real_path | string replace -r ' (.*)\ /bin\ /elixir' ' $1' )
33+ end
34+
2635 # readlink_f changes the current directory (since fish doesn't have
2736 # subshells), so it needs to be restored.
2837 cd $current_dir
You can’t perform that action at this time.
0 commit comments