Moritz Heidkamp  committed 2fc085a

only purge existing installation before actually installing so as not to lose the existing one if the build fails (thanks Christian Kellermann for the suggestion)

  • Participants
  • Parent commits c819012
  • Branches master

Comments (0)

Files changed (1)

File chicken-build.scm

     (unless (and success? (zero? status))
       (exit 1))))
+(define purge? #f)
 (when (file-exists? chicken-path)
   (printf "Chicken already exists: ~A" chicken-path)
-  (if (yes-or-no? "Purge and continue?" #f #f exit)
-      (run "rm" "-rf" chicken-path)
+  (if (yes-or-no? "Continue? This will purge the existing directory before installation." #f #f exit)
+      (set! purge? #t)
-(create-directory chicken-path)
 (when build-boot-chicken?
   (run "make" "boot-chicken")
   (setenv "CHICKEN" "./chicken-boot"))
   (setenv "DEBUGBUILD" "1"))
 (setenv "PREFIX" chicken-path)
 (run "make")
+(when purge?
+  (run "rm" "-rf" chicken-path))
+(create-directory chicken-path)
 (run "make" "install")