! Copyright (C) 2008, 2010 Eduardo Cavazos, Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
-USING: kernel io.launcher bootstrap.image.download
-mason.common mason.platform ;
+USING: bootstrap.image.download combinators.short-circuit
+io.directories io.launcher kernel mason.common mason.platform ;
IN: mason.updates
+: git-reset-cmd ( -- cmd )
+ {
+ "git"
+ "reset"
+ "--hard"
+ "HEAD"
+ } ;
+
: git-pull-cmd ( -- cmd )
{
"git"
} ;
: updates-available? ( -- ? )
+ ".git/index" delete-file
+ git-reset-cmd short-running-process
git-id
git-pull-cmd short-running-process
git-id
boot-image-name maybe-download-image ;
: new-code-available? ( -- ? )
- updates-available?
- new-image-available?
- or ;
\ No newline at end of file
+ { [ updates-available? ] [ new-image-available? ] } 0|| ;