   [ my-arch download-image ]
   [ ]
   [ "builder: image download" email-string ]
-  cleanup ;
+  cleanup
+  flush ;
 
 : bootstrap ( -- desc )
   `{

SYMBOL: build-status

: build ( -- )

  "running" build-status set-global

  "/builds/factor" cd

  git-pull "git pull error" run-or-notify

  enter-build-dir
  


  "../failing-tests" exists?
  [ "failing tests" "../failing-tests" email-file ]
  when ;

! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

: minutes>ms ( min -- ms ) 60 * 1000 * ;

: updates-available? ( -- ? )
  git-id
  git-pull run-process drop
  git-id
  = not ;

: build-loop ( -- )
  [
    "/builds/factor" cd
    updates-available?
      [ build ]
    when
  ]
  [ drop ]
  recover
  5 minutes>ms sleep
  build-loop ;

! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

MAIN: build-loop