cleanup
This commit is contained in:
parent
56bc3e95ca
commit
efa7f54405
1 changed files with 6 additions and 11 deletions
17
Command.hs
17
Command.hs
|
@ -58,20 +58,20 @@ type CommandSeekNothing = CommandStart -> CommandSeek
|
||||||
type CommandStartNothing = CommandStart
|
type CommandStartNothing = CommandStart
|
||||||
|
|
||||||
data Command = Command {
|
data Command = Command {
|
||||||
|
cmdusesrepo :: Bool,
|
||||||
cmdname :: String,
|
cmdname :: String,
|
||||||
cmdparams :: String,
|
cmdparams :: String,
|
||||||
cmdseek :: [CommandSeek],
|
cmdseek :: [CommandSeek],
|
||||||
cmddesc :: String,
|
cmddesc :: String
|
||||||
cmdusesrepo :: Bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{- Most commands operate on files in a git repo. -}
|
{- Most commands operate on files in a git repo. -}
|
||||||
repoCommand :: String -> String -> [CommandSeek] -> String -> Command
|
repoCommand :: String -> String -> [CommandSeek] -> String -> Command
|
||||||
repoCommand n p s d = Command n p s d True
|
repoCommand = Command True
|
||||||
|
|
||||||
{- Others can run anywhere. -}
|
{- Others can run anywhere. -}
|
||||||
standaloneCommand :: String -> String -> [CommandSeek] -> String -> Command
|
standaloneCommand :: String -> String -> [CommandSeek] -> String -> Command
|
||||||
standaloneCommand n p s d = Command n p s d False
|
standaloneCommand = Command False
|
||||||
|
|
||||||
{- For start and perform stages to indicate what step to run next. -}
|
{- For start and perform stages to indicate what step to run next. -}
|
||||||
next :: a -> Annex (Maybe a)
|
next :: a -> Annex (Maybe a)
|
||||||
|
@ -102,13 +102,8 @@ doCommand start = do
|
||||||
return False
|
return False
|
||||||
Just cleanup -> do
|
Just cleanup -> do
|
||||||
c <- cleanup
|
c <- cleanup
|
||||||
if c
|
if c then showEndOk else showEndFail
|
||||||
then do
|
return c
|
||||||
showEndOk
|
|
||||||
return True
|
|
||||||
else do
|
|
||||||
showEndFail
|
|
||||||
return False
|
|
||||||
|
|
||||||
notAnnexed :: FilePath -> Annex (Maybe a) -> Annex (Maybe a)
|
notAnnexed :: FilePath -> Annex (Maybe a) -> Annex (Maybe a)
|
||||||
notAnnexed file a = do
|
notAnnexed file a = do
|
||||||
|
|
Loading…
Reference in a new issue