Skip to content

Commit

Permalink
name change
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierverdier committed Dec 28, 2014
1 parent 9bc2aaa commit 3ef1907
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ makeHash = (':' :) . maybe "" init

{- Git commands -}

maybeResult :: (ExitCode, a, b) -> Maybe a
maybeResult (exitCode, output, _) =
successOrNothing :: (ExitCode, a, b) -> Maybe a
successOrNothing (exitCode, output, _) =
if exitCode == ExitSuccess then Just output else Nothing

safeRun :: String -> [String] -> IO (Maybe String)
safeRun command arguments = maybeResult <$> readProcessWithExitCode command arguments ""
safeRun command arguments = successOrNothing <$> readProcessWithExitCode command arguments ""

gitstatus :: IO (Maybe String)
gitstatus = safeRun "git" ["status", "--porcelain", "--branch"]
Expand Down

0 comments on commit 3ef1907

Please sign in to comment.