on master help sign in
cosmetic: use nicer indentation and if style
commit50d4efb705171f45179ea3895fbbdaa3829dc7f1 authorEvan Czaplicki <info@elm-lang.org> dateFri 20 Nov 2015, 08:06 (11 years ago) parentcb1bad3
1 file changed+16−6
src/Elm/Utils.hs+16−6
src/Elm/Utils.hs+16−6
@@ -59,7 +59,9 @@ run :: (MonadError String m, MonadIO m) => String -> [String] -> m String
5959run command args =
6060 do result <- liftIO (unwrappedRun command args)
6161 case result of
62− Right out -> return out
62+ Right out ->
63+ return out
64+
6365 Left err ->
6466 throwError (context (message err))
6567 where
@@ -70,6 +72,7 @@ run command args =
7072 case err of
7173 CommandFailed stderr stdout ->
7274 stdout ++ stderr
75+
7376 MissingExe msg ->
7477 msg
7578
@@ -79,11 +82,18 @@ unwrappedRun command args =
7982 do (exitCode, stdout, stderr) <- readProcessWithExitCode command args ""
8083 return $
8184 case exitCode of
82− ExitSuccess -> Right stdout
83− ExitFailure code
84− | code == 127 -> Left (missingExe command) -- UNIX
85− | code == 9009 -> Left (missingExe command) -- Windows
86− | otherwise -> Left (CommandFailed stdout stderr)
85+ ExitSuccess ->
86+ Right stdout
87+
88+ ExitFailure code ->
89+ if code == 127 then
90+ Left (missingExe command) -- UNIX
91+
92+ else if code == 9009 then
93+ Left (missingExe command) -- Windows
94+
95+ else
96+ Left (CommandFailed stdout stderr)
8797
8898
8999missingExe :: String -> CommandError