io.standard-paths: add ?find-in-path.

db4
John Benediktsson 2015-06-01 14:26:38 -07:00
parent 2884f8dabe
commit 0d7c3c5291
1 changed files with 7 additions and 3 deletions

View File

@ -11,9 +11,13 @@ HOOK: find-in-path* os ( string -- path/f )
HOOK: find-in-applications os ( directories filename -- path ) HOOK: find-in-applications os ( directories filename -- path )
: find-in-path ( string -- path/f ) : find-in-path ( string -- path/f )
[ f ] [ f ] [
[ [ find-in-path* ] keep over [ append-path ] [ 2drop f ] if ] [ find-in-path* ] keep over
if-empty ; [ append-path ] [ 2drop f ] if
] if-empty ;
: ?find-in-path ( string -- path/string )
[ find-in-path ] [ or ] bi ;
{ {
{ [ os windows? ] [ "io.standard-paths.windows" ] } { [ os windows? ] [ "io.standard-paths.windows" ] }