]> gitweb.factorcode.org Git - factor.git/commitdiff
tools.scaffold: delete from root cache but allow vocab to exist already.
authorDoug Coleman <doug.coleman@gmail.com>
Fri, 15 Jun 2018 23:09:21 +0000 (18:09 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 15 Jun 2018 23:09:21 +0000 (18:09 -0500)
If tools.scaffold fails, it is nice to rerun it to finish scaffolding anything it failed on and have it give you links to the files.

basis/tools/scaffold/scaffold.factor

index d4da9a78ae525eb055fed9337db8a6d2705ccc6f..b264dcf44a459062b0e2079889a6309ea5130cb4 100644 (file)
@@ -30,10 +30,6 @@ ERROR: vocab-must-not-exist 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
-    dup root-cache get delete-at ;
-
 : replace-vocab-separators ( vocab -- path )
     path-separator first CHAR: . associate substitute ;
 
@@ -288,8 +284,12 @@ PRIVATE>
 : scaffold-platforms ( vocab platforms -- )
     [ "platforms.txt" ] dip scaffold-metadata ;
 
+: delete-from-root-cache ( string -- )
+    root-cache get delete-at ;
+
 : scaffold-vocab ( vocab-root string -- )
-    check-vocab-exists {
+    dup delete-from-root-cache
+    {
         [ scaffold-directory ]
         [ scaffold-main ]
         [ nip require ]