From 7fe22b14f86178d57e583bc19bd4fbf94f60aa5f Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Wed, 29 Apr 2009 19:06:06 -0500 Subject: [PATCH] don't scaffold an authors file if the developer-name is not set --- basis/tools/scaffold/scaffold.factor | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/basis/tools/scaffold/scaffold.factor b/basis/tools/scaffold/scaffold.factor index 5034207c98..63dc951d60 100755 --- a/basis/tools/scaffold/scaffold.factor +++ b/basis/tools/scaffold/scaffold.factor @@ -6,7 +6,7 @@ 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 combinators.short-circuit alarms words.symbol -system ; +system summary ; IN: tools.scaffold SYMBOL: developer-name @@ -16,6 +16,10 @@ ERROR: not-a-vocab-root string ; ERROR: vocab-name-contains-separator path ; ERROR: vocab-name-contains-dot path ; ERROR: no-vocab vocab ; +ERROR: bad-developer-name name ; + +M: bad-developer-name summary + drop "Developer name must be a string." ; path scaffolding? [ - [ developer-name get ] dip utf8 set-file-contents + developer-name get [ + dup string? [ bad-developer-name ] unless + "authors.txt" vocab-root/vocab/file>path scaffolding? [ + utf8 set-file-contents + ] [ + 2drop + ] if ] [ - drop - ] if ; + 2drop + ] if* ; : lookup-type ( string -- object/string ? ) "new" ?head drop [ { [ CHAR: ' = ] [ digit? ] } 1|| ] trim-tail