mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-08 01:11:38 +08:00
Use system over callCommand to allow linking on ghc 7.6.3.
This commit is contained in:
15
Setup.hs
15
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"
|
||||
|
Reference in New Issue
Block a user