]> gitweb.factorcode.org Git - factor.git/blob - basis/io/standard-paths/standard-paths.factor
Make "foo.private" require load foo instead.
[factor.git] / basis / io / standard-paths / standard-paths.factor
1 ! Copyright (C) 2011 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: combinators io.pathnames kernel sequences system
4 vocabs ;
5 IN: io.standard-paths
6
7 HOOK: find-native-bundle os ( string -- path )
8
9 HOOK: find-in-path* os ( string -- path/f )
10
11 HOOK: find-in-applications os ( directories filename -- path )
12
13 : find-in-path ( string -- path/f )
14     [ f ]
15     [ [ find-in-path* ] keep over [ append-path ] [ 2drop f ] if ]
16     if-empty ;
17
18 os {
19     { [ dup macosx? ] [ drop "io.standard-paths.macosx" require ] }
20     { [ dup unix? ] [ drop "io.standard-paths.unix" require ] }
21     { [ dup windows? ] [ drop "io.standard-paths.windows" require ] }
22 } cond
23