We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3cd9f6b commit 57bfbd0Copy full SHA for 57bfbd0
1 file changed
scripts/launch.fish
@@ -22,7 +22,16 @@ function export_stdlib_path
22
set -l current_dir (pwd)
23
24
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')
+ # 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
35
# readlink_f changes the current directory (since fish doesn't have
36
# subshells), so it needs to be restored.
37
cd $current_dir
0 commit comments