]> gitweb.factorcode.org Git - factor.git/commitdiff
io.files.temp: allow default-cache-directory to work on macports builders
authorJohn Benediktsson <mrjbq7@gmail.com>
Sat, 6 Jan 2024 03:58:44 +0000 (19:58 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sat, 6 Jan 2024 03:58:44 +0000 (19:58 -0800)
basis/io/files/temp/macosx/macosx.factor
basis/io/files/temp/temp.factor
basis/io/files/temp/unix/unix.factor

index 6e932f2147d78fa8f00594aa5eb1143b437f9db6..c5ad304388123005d06284bc4a5f9bb7cadc27ae 100644 (file)
@@ -26,9 +26,8 @@ CONSTANT: factor-bundle-name "org.factorcode.Factor"
 : factor-bundle-subdir ( path -- path )
     factor-bundle-name append-path ;
 
-: first-existing ( paths -- path )
-    [ file-exists? ] find nip
-    [ "no user cache directory found" throw ] unless* ; inline
+: first-existing ( paths -- path/f )
+    [ file-exists? ] find nip ; inline
 
 PRIVATE>
 
@@ -37,4 +36,4 @@ M: macosx default-temp-directory
 
 M: macosx default-cache-directory
     NSCachesDirectory NSUserDomainMask 1 NSSearchPathForDirectoriesInDomains
-    plist> first-existing factor-bundle-subdir ;
+    plist> first-existing [ call-next-method ] unless* factor-bundle-subdir ;
index 8efa066a1c968202b7bc4b3c9eade474627bb889..ba0c35f29fcf55e81e4d9776b418d62fbe067ff7 100644 (file)
@@ -32,7 +32,6 @@ SYMBOL: current-cache-directory
 
 {
     { [ os windows? ] [ "io.files.temp.windows" ] }
-    { [ os macosx? ] [ "io.files.temp.macosx" ] }
     { [ os unix? ] [ "io.files.temp.unix" ] }
 } cond require
 
index f6864b4abe1f3eeea0fdfd2d161fcf00b6b2d551..39d7b214bc542af5ed82735d280b7b7e1b7170f7 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2012 Joe Groff.
 ! See https://factorcode.org/license.txt for BSD license.
-USING: environment io.files.temp io.pathnames sequences system
-xdg ;
+USING: environment io.files.temp io.pathnames kernel sequences
+system vocabs xdg ;
 IN: io.files.temp.unix
 
 M: unix default-temp-directory
@@ -9,3 +9,5 @@ M: unix default-temp-directory
 
 M: unix default-cache-directory
     xdg-cache-home "factor" append-path absolute-path ;
+
+os macosx? [ "io.files.temp.macosx" require ] when