summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/SiteSpecific/GitHome.hs
diff options
context:
space:
mode:
authorJoey Hess2016-03-26 17:33:43 -0400
committerJoey Hess2016-03-26 17:33:43 -0400
commitc85c462c617fe31c3fe8c97d85db4bcae838a8b2 (patch)
treeee4bba7bfafcec2e0cff92597d2e7b86db8f7ad0 /src/Propellor/Property/SiteSpecific/GitHome.hs
parente4ac94860bcc4511370e878e14ef9d45b60aeb2a (diff)
more ported
Diffstat (limited to 'src/Propellor/Property/SiteSpecific/GitHome.hs')
-rw-r--r--src/Propellor/Property/SiteSpecific/GitHome.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Propellor/Property/SiteSpecific/GitHome.hs b/src/Propellor/Property/SiteSpecific/GitHome.hs
index 83a1a16a..f14b5f12 100644
--- a/src/Propellor/Property/SiteSpecific/GitHome.hs
+++ b/src/Propellor/Property/SiteSpecific/GitHome.hs
@@ -5,14 +5,15 @@ import qualified Propellor.Property.Apt as Apt
import Propellor.Property.User
-- | Clones Joey Hess's git home directory, and runs its fixups script.
-installedFor :: User -> Property NoInfo
+installedFor :: User -> Property DebianLike
installedFor user@(User u) = check (not <$> hasGitDir user) $
- property ("githome " ++ u) (go =<< liftIO (homedir user))
- `requires` Apt.installed ["git"]
+ go `requires` Apt.installed ["git"]
where
- go home = do
+ go :: Property DebianLike
+ go = property' ("githome " ++ u) $ \w -> do
+ home <- liftIO (homedir user)
let tmpdir = home </> "githome"
- ensureProperty $ combineProperties "githome setup"
+ ensureProperty w $ combineProperties "githome setup" $ toProps
[ userScriptProperty user ["git clone " ++ url ++ " " ++ tmpdir]
`assume` MadeChange
, property "moveout" $ makeChange $ void $