tools.scaffold: make sure vocab does not exist.

windows-high-dpi
John Benediktsson 2018-02-24 15:49:32 -08:00
parent c99ab4a652
commit 68eb683387
1 changed files with 6 additions and 1 deletions

View File

@ -14,6 +14,8 @@ SYMBOL: using
ERROR: not-a-vocab-root string ;
ERROR: vocab-must-not-exist string ;
<PRIVATE
: vocab-root? ( string -- ? )
@ -28,6 +30,9 @@ ERROR: not-a-vocab-root string ;
: check-vocab-root/vocab ( vocab-root string -- vocab-root string )
[ check-root ] [ check-vocab-name ] bi* ;
: check-vocab-exists ( string -- string )
dup vocab-exists? [ vocab-must-not-exist ] when ;
: replace-vocab-separators ( vocab -- path )
path-separator first CHAR: . associate substitute ; inline
@ -273,7 +278,7 @@ PRIVATE>
[ "platforms.txt" ] dip scaffold-metadata ;
: scaffold-vocab ( vocab-root string -- )
{
check-vocab-exists {
[ scaffold-directory ]
[ scaffold-main ]
[ nip require ]