Skip to content

Commit 8a9fd3d

Browse files
authored
fix: support Nushell for PATH detection (#272)
1 parent 35ba0df commit 8a9fd3d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

apps/expert/lib/expert/port.ex

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,14 @@ defmodule Expert.Port do
106106

107107
["-l", "-c", cmd]
108108

109+
"nu" ->
110+
# Nushell stores PATH as a list in $env.PATH, so we join with colons.
111+
# Nushell doesn't support && operator, use ; instead.
112+
cmd =
113+
"cd #{directory}; print $\"#{@path_marker}:($env.PATH | str join \":\"):#{@path_marker}\""
114+
115+
["-l", "-c", cmd]
116+
109117
_ ->
110118
cmd = "cd #{directory} && printf \"#{@path_marker}:%s:#{@path_marker}\" \"$PATH\""
111119
["-i", "-l", "-c", cmd]

0 commit comments

Comments
 (0)