diff options
author | 2011-01-28 12:35:51 -0400 | |
---|---|---|
committer | 2011-01-28 12:35:51 -0400 | |
commit | 04fe906ac6e611fd59ef44244a01e8fe61abec6f (patch) | |
tree | cfcc6f6ca79bc55606135088d609237a8aacd1b2 /Command/Init.hs | |
parent | 4f9336bb60ca4dc08ca271605de71415c98ec3ff (diff) |
use safewritefile
Diffstat (limited to 'Command/Init.hs')
-rw-r--r-- | Command/Init.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Command/Init.hs b/Command/Init.hs index e780c8863..2976b988d 100644 --- a/Command/Init.hs +++ b/Command/Init.hs @@ -20,6 +20,7 @@ import Version import Messages import Locations import Types +import Utility command :: [Command] command = [Command "init" paramDesc seek @@ -61,7 +62,7 @@ gitAttributesWrite repo = do exists <- doesFileExist attributes if not exists then do - writeFile attributes $ attrLine ++ "\n" + safeWriteFile attributes $ attrLine ++ "\n" commit else do content <- readFile attributes @@ -85,7 +86,7 @@ gitPreCommitHookWrite repo = do if exists then warning $ "pre-commit hook (" ++ hook ++ ") already exists, not configuring" else liftIO $ do - writeFile hook preCommitScript + safeWriteFile hook preCommitScript p <- getPermissions hook setPermissions hook $ p {executable = True} where |