io.standard-paths: fix standard-login-paths for fish shell

Fish shell automatically split variables whose name ends in "PATH" into lists,
and uses space as separator for output
Colons force fish to use standard $PATH representation
master
Sergii Fesenko 2020-05-16 16:52:09 +03:00 committed by John Benediktsson
parent 413cc49d3b
commit 4353b05cf1
2 changed files with 6 additions and 1 deletions

View File

@ -14,3 +14,8 @@ sequences tools.test ;
{ "/bin/ps" "/sbin/ps" "/usr/bin/ps" } member?
] with-os-env
] unit-test
{ t } [
"ls" find-in-standard-login-path
{ "/bin/ls" "/usr/bin/ls" } member?
] unit-test

View File

@ -16,7 +16,7 @@ M: unix find-in-path*
utf8 decode [ blank? ] trim ":" split ;
: standard-login-paths ( -- strings )
{ "-l" "-c" "echo $PATH" }
{ "-l" "-c" "echo \"$PATH\"" }
effective-user-id user-passwd shell>> prefix
binary <process-reader> stream-contents parse-login-paths ;