mirror of
https://github.com/google/ormolu.git
synced 2025-01-07 15:50:27 +03:00
Use explicit error code in check
mode
This commit is contained in:
parent
b2024bfc3d
commit
42c91987bf
@ -12,7 +12,7 @@ import Development.GitRev
|
||||
import Options.Applicative
|
||||
import Ormolu
|
||||
import Paths_ormolu (version)
|
||||
import System.Exit (exitFailure)
|
||||
import System.Exit (ExitCode (..), exitWith)
|
||||
import qualified Data.Text.IO as TIO
|
||||
import qualified Data.Yaml as Yaml
|
||||
|
||||
@ -34,7 +34,10 @@ main = withPrettyOrmoluExceptions $ do
|
||||
TIO.writeFile optInputFile r
|
||||
Check -> do
|
||||
r' <- TIO.readFile optInputFile
|
||||
when (r /= r') exitFailure
|
||||
when (r /= r') . exitWith $
|
||||
ExitFailure 100 -- 100 is different to all the other exit code that
|
||||
-- are emitted either from an 'OrmoluException' or
|
||||
-- from 'error' and 'notImplemented'.
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
-- Command line options parsing.
|
||||
|
@ -10,7 +10,7 @@ where
|
||||
|
||||
import Control.Exception
|
||||
import Data.Text (Text)
|
||||
import System.Exit (ExitCode (ExitFailure), exitWith)
|
||||
import System.Exit (ExitCode (..), exitWith)
|
||||
import System.IO
|
||||
import qualified GHC
|
||||
import qualified Outputable as GHC
|
||||
|
Loading…
Reference in New Issue
Block a user