summaryrefslogtreecommitdiff
path: root/src/Propellor
diff options
context:
space:
mode:
authorJoey Hess2014-11-22 00:44:13 -0400
committerJoey Hess2014-11-22 00:44:13 -0400
commit0d65fdeb1dcb414b0fb1d5719dd734a1b04da1e5 (patch)
tree098ee220101b359c07a8696247de90e67d7f9340 /src/Propellor
parent083b82d8100ef1915a00f8fbcd1530b85448dc9d (diff)
propellor spin
Diffstat (limited to 'src/Propellor')
-rw-r--r--src/Propellor/Server.hs19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/Propellor/Server.hs b/src/Propellor/Server.hs
index fde9c2ec..06fede7e 100644
--- a/src/Propellor/Server.hs
+++ b/src/Propellor/Server.hs
@@ -27,17 +27,19 @@ import Utility.SafeCommand
-- running the updateServer
update :: IO ()
update = do
- req NeedRepoUrl repoUrlMarker setRepoUrl
+ whenM hasOrigin $
+ req NeedRepoUrl repoUrlMarker setRepoUrl
makePrivDataDir
req NeedPrivData privDataMarker $
writeFileProtected privDataLocal
- req NeedGitPush gitPushMarker $ \_ -> do
- hin <- dup stdInput
- hout <- dup stdOutput
- hClose stdin
- hClose stdout
- unlessM (boolSystem "git" (pullparams hin hout)) $
- errorMessage "git pull from client failed"
+ whenM hasOrigin $
+ req NeedGitPush gitPushMarker $ \_ -> do
+ hin <- dup stdInput
+ hout <- dup stdOutput
+ hClose stdin
+ hClose stdout
+ unlessM (boolSystem "git" (pullparams hin hout)) $
+ errorMessage "git pull from client failed"
where
pullparams hin hout =
[ Param "pull"
@@ -76,6 +78,7 @@ updateServer hn hst connect = connect go
hClose toh
hClose fromh
sendPrecompiled hn
+ loop
Nothing -> return ()
sendRepoUrl :: Handle -> IO ()