Skip to content

Commit

Permalink
Pass the exit code of the preBuildHook to the postBuildHook
Browse files Browse the repository at this point in the history
  • Loading branch information
erikd committed May 9, 2024
1 parent 98b6d7f commit 33aabe0
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ buildAndInstallUnpackedPackage
hooksDir <- (</> "cabalHooks") <$> getCurrentDirectory
-- run preBuildHook. If it returns with 0, we assume the build was
-- successful. If not, run the build.
void $
preCode <-
rawSystemExitCode
verbosity
(Just srcdir)
Expand All @@ -706,6 +706,7 @@ buildAndInstallUnpackedPackage
[ (unUnitId $ installedUnitId rpkg)
, (getSymbolicPath srcdir)
, (getSymbolicPath builddir)
, show preCode
]
Nothing
`catchIO` (\_ -> pure (ExitFailure 10))
Expand Down

0 comments on commit 33aabe0

Please sign in to comment.