directory throws now instead of returning nicely if does not exist

db4
Doug Coleman 2008-10-19 18:47:23 -05:00
parent e310e382c5
commit e4b6cd7578
1 changed files with 6 additions and 3 deletions

View File

@ -207,13 +207,16 @@ M: vocab-link summary vocab-summary ;
dup vocab-authors-path set-vocab-file-contents ; dup vocab-authors-path set-vocab-file-contents ;
: subdirs ( dir -- dirs ) : subdirs ( dir -- dirs )
[ dup [
[ link-info directory? ] filter [ link-info directory? ] filter
] with-directory-files natural-sort ; ] with-directory-files
[ append-path ] with map natural-sort ;
: (all-child-vocabs) ( root name -- vocabs ) : (all-child-vocabs) ( root name -- vocabs )
[ vocab-dir append-path subdirs ] keep
[ [
vocab-dir append-path dup exists?
[ subdirs ] [ drop { } ] if
] keep [
swap [ "." swap 3append ] with map swap [ "." swap 3append ] with map
] unless-empty ; ] unless-empty ;