Commits

Moritz Heidkamp committed 8cca933

chicken-build: check for existence of CHICKENS only when it's actually needed, i.e. after checking for zero args or -h (thanks again Mario Goulart)

Comments (0)

Files changed (3)

chicken-build.scm

      (printf-error "Invalid arguments: ~S" rest)
      (usage fail))))
 
+(assert-chicken-coop-exists)
+
 (unless chicken-name
   (usage fail))
 
   (newline (current-error-port))
   (exit 1))
 
-(unless (and (file-exists? chicken-coop) (directory? chicken-coop))
-  (fail "CHICKENS does not exist or is not a directory: ~S" chicken-coop))
+(define (assert-chicken-coop-exists)
+  (unless (and (file-exists? chicken-coop) (directory? chicken-coop))
+    (fail "CHICKENS does not exist or is not a directory: ~S" chicken-coop)))

chicken-select.scm

 (use srfi-1 posix)
 (include "chicken-env")
 
+(assert-chicken-coop-exists)
+
 (define (available-chickens)
   (filter (lambda (p) (not (equal? chicken-link p)))
           (directory chicken-coop)))