refactor some boilerplate

This commit is contained in:
Joey Hess 2011-05-15 02:02:46 -04:00
parent b400984ddf
commit 56bc3e95ca
31 changed files with 93 additions and 86 deletions

View file

@ -35,7 +35,7 @@ start description = do
when (null description) $
error "please specify a description of this repository\n"
showStart "init" description
return $ Just $ perform description
next $ perform description
perform :: String -> CommandPerform
perform description = do
@ -48,12 +48,12 @@ perform description = do
"This is a bare repository, so its description cannot be committed.\n" ++
"To record the description, run this command in a clone of this repository:\n" ++
" git annex describe " ++ show u ++ " " ++ show description ++ "\n\n"
return $ Just $ return True
next $ return True
else do
describeUUID u description
liftIO $ gitAttributesWrite g
gitPreCommitHookWrite g
return $ Just cleanup
next cleanup
cleanup :: CommandCleanup
cleanup = do