<commit_before>! Copyright (C) 2011 <NAME>.
! See http://factorcode.org/license.txt for BSD license.
USING: combinators io.pathnames kernel sequences system
vocabs ;
IN: io.standard-paths

HOOK: find-native-bundle os ( string -- path )

HOOK: find-in-path* os ( string -- path/f )

HOOK: find-in-applications os ( directories filename -- path )

HOOK: find-in-standard-login-path* os ( string -- path/f )

M: object find-in-standard-login-path*
    find-in-path* ;

: find-in-path ( string -- path/f )
    [ f ] [
        [ find-in-path* ] keep over
        [ append-path ] [ 2drop f ] if
    ] if-empty ;

: ?find-in-path ( string -- path/string )
    [ find-in-path ] [ or ] bi ;

: find-in-standard-login-path ( string -- path/f )
    [ f ] [
        [ find-in-standard-login-path* ] keep over
        [ append-path ] [ 2drop f ] if
    ] if-empty ;

{
    { [ os windows? ] [ "io.standard-paths.windows" ] }
    { [ os macosx? ] [ "io.standard-paths.macosx" ] }
} cond require

os unix? [ "io.standard-paths.unix" require ] when<commit_msg>io.standard-paths: fix logic for linux<commit_after>! Copyright (C) 2011 <NAME>.
! See http://factorcode.org/license.txt for BSD license.
USING: combinators io.pathnames kernel sequences system
vocabs ;
IN: io.standard-paths

HOOK: find-native-bundle os ( string -- path )

HOOK: find-in-path* os ( string -- path/f )

HOOK: find-in-applications os ( directories filename -- path )

HOOK: find-in-standard-login-path* os ( string -- path/f )

M: object find-in-standard-login-path*
    find-in-path* ;

: find-in-path ( string -- path/f )
    [ f ] [
        [ find-in-path* ] keep over
        [ append-path ] [ 2drop f ] if
    ] if-empty ;

: ?find-in-path ( string -- path/string )
    [ find-in-path ] [ or ] bi ;

: find-in-standard-login-path ( string -- path/f )
    [ f ] [
        [ find-in-standard-login-path* ] keep over
        [ append-path ] [ 2drop f ] if
    ] if-empty ;

{
    { [ os windows? ] [ "io.standard-paths.windows" ] }
    { [ os unix? ] [ "io.standard-paths.unix" ] }
} cond require

os macosx? [ "io.standard-paths.macosx" require ] when
{'fraction_non_alphanumeric': 0.16138192143871274, 'fraction_numerical': 0.005679129200189304, 'mean_word_length': 2.43739837398374, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6336069', 'n_tokens_mistral': 777, 'n_tokens_neox': 761, 'n_words': 177}