]> gitweb.factorcode.org Git - factor.git/commitdiff
io.standard-paths: fix standard-login-paths for fish shell
authorSergii Fesenko <sergii_f@outlook.com>
Sat, 16 May 2020 13:52:09 +0000 (16:52 +0300)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sat, 16 May 2020 14:03:23 +0000 (07:03 -0700)
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

basis/io/standard-paths/unix/unix-tests.factor
basis/io/standard-paths/unix/unix.factor

index 986c0564d251b4043c1ac1e5b169b98aef6ac11d..221a8ac855616731a01e20877d39a0a346bda440 100644 (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
index af9c35369a390579a465e67733cd09774aca18e8..107f28a05af946cd7065e84a1e15dfd0c639ac5f 100644 (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 ;