diff --git a/Setup.hs b/Setup.hs index 9d2272813c3df2875828895023dcb17fafb8f340..e6064f90aa74476d6ccb08473395b89fa3fcfa21 100644 --- a/Setup.hs +++ b/Setup.hs @@ -8,21 +8,13 @@ import Distribution.Simple ( simpleUserHooks ) import Distribution.Simple.Setup ( SDistFlags ) --- | This requires the process package from, --- --- https://hackage.haskell.org/package/process --- -import System.Process ( callCommand ) +import System.Process ( system ) --- | This will use almost the default implementation, except we switch --- out the default pre-sdist hook with our own, 'myPreSDist'. --- main = defaultMainWithHooks myHooks where myHooks = simpleUserHooks { preSDist = myPreSDist } - -- | This hook will be executed before e.g. @cabal sdist@. It runs -- pandoc to create the man page from shellcheck.1.md. If the pandoc -- command is not found, this will fail with an error message: @@ -35,9 +27,10 @@ main = defaultMainWithHooks myHooks -- myPreSDist :: Args -> SDistFlags -> IO HookedBuildInfo myPreSDist _ _ = do - putStrLn "Building the man page..." + putStrLn "Building the man page (shellcheck.1) with pandoc..." putStrLn pandoc_cmd - callCommand pandoc_cmd + result <- system pandoc_cmd + putStrLn $ "pandoc exited with " ++ show result return emptyHookedBuildInfo where pandoc_cmd = "pandoc -s -t man shellcheck.1.md -o shellcheck.1" diff --git a/ShellCheck.cabal b/ShellCheck.cabal index 900647dc77fced4bb22122e7c0a59a7eb5f1a929..f0e92f8c84efbbbe7914e6942e409c58d66d011e 100644 --- a/ShellCheck.cabal +++ b/ShellCheck.cabal @@ -44,7 +44,9 @@ library mtl >= 2.2.1, parsec, regex-tdfa, - QuickCheck >= 2.7.4 + QuickCheck >= 2.7.4, + -- When cabal supports it, move this to setup-depends: + process exposed-modules: ShellCheck.AST ShellCheck.ASTLib @@ -87,7 +89,6 @@ test-suite test-shellcheck mtl >= 2.2.1, parsec, regex-tdfa, - QuickCheck >= 2.7.4, - process >= 1.2.0.0 + QuickCheck >= 2.7.4 main-is: test/shellcheck.hs