 vocabs.loader io combinators calendar accessors math.parser
 io.streams.string ui.tools.operations quotations strings arrays
 prettyprint words vocabs sorting sets classes math alien urls
-splitting ascii ;
+splitting ascii combinators.short-circuit ;
 IN: tools.scaffold
 
 SYMBOL: developer-name


<PRIVATE

: root? ( string -- ? ) vocab-roots get member? ;

: contains-dot? ( string -- ? ) ".." swap subseq? ;

: contains-separator? ( string -- ? ) [ path-separator? ] any? ;

: check-vocab-name ( string -- string )
    dup contains-dot? [ vocab-name-contains-dot ] when
    dup contains-separator? [ vocab-name-contains-separator ] when ;

: check-root ( string -- string )
    dup root? [ not-a-vocab-root ] unless ;

: directory-exists ( path -- )
    "Not creating a directory, it already exists: " write print ;

    {
        [ drop scaffold-directory ]
        [ scaffold-main ]
        [ drop scaffold-authors ]
        [ nip require ]
    } 2cleave ;
