From 2df64dc516971f3186fc4b05df63bd3cbdb0fa1c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 31 Mar 2014 17:57:12 -0400 Subject: [PATCH] propellor spin --- Propellor/CmdLine.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Propellor/CmdLine.hs b/Propellor/CmdLine.hs index 8d60025..aea1d6c 100644 --- a/Propellor/CmdLine.hs +++ b/Propellor/CmdLine.hs @@ -57,7 +57,7 @@ defaultMain getprops = go True =<< processCmdLine go _ (Set host field) = setPrivData host field go _ (AddKey keyid) = addKey keyid go _ (Spin host) = withprops host $ const $ spin host - go True cmdline = pullFirst cmdline $ go False cmdline + go True cmdline = updateFirst cmdline $ go False cmdline go _ (Run host) = withprops host $ ensureProperties go _ (Boot host) = withprops host $ boot @@ -69,8 +69,8 @@ unknownhost h = error $ unwords , "(perhaps you should specify the real hostname on the command line?)" ] -pullFirst :: CmdLine -> IO () -> IO () -pullFirst cmdline next = do +updateFirst :: CmdLine -> IO () -> IO () +updateFirst cmdline next = do branchref <- takeWhile (/= '\n') <$> readProcess "git" ["symbolic-ref", "HEAD"] let originbranch = "origin" takeFileName branchref @@ -106,6 +106,7 @@ pullFirst cmdline next = do then next else do putStrLn "Rebuilding propeller.." + print (oldsha, newsha) hFlush stdout ifM (boolSystem "make" [Param "build"]) ( void $ boolSystem "./propellor" [Param "--continue", Param (show cmdline)]