summaryrefslogtreecommitdiff
path: root/Propellor/CmdLine.hs
diff options
context:
space:
mode:
authorJoey Hess2014-03-31 17:57:12 -0400
committerJoey Hess2014-03-31 17:57:12 -0400
commit2df64dc516971f3186fc4b05df63bd3cbdb0fa1c (patch)
tree899c6b14737778443997bb2e4816f1254bf9c0f7 /Propellor/CmdLine.hs
parent40e697556c29f2a6055f62b053f496bf4175ba7f (diff)
propellor spin
Diffstat (limited to 'Propellor/CmdLine.hs')
-rw-r--r--Propellor/CmdLine.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Propellor/CmdLine.hs b/Propellor/CmdLine.hs
index 8d600255..aea1d6c2 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)]