Last active
February 26, 2018 14:40
-
-
Save DanielG/c95205997ea2ae23eb66f813c3d1f096 to your computer and use it in GitHub Desktop.
cabal-new-build-then-haddock-repro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: cabal-build-then-haddock-repro | |
version: 0.1.0.0 | |
license: BSD3 | |
license-file: LICENSE | |
author: Daniel Gröber | |
maintainer: daniel@dps.uibk.ac.at | |
build-type: Simple | |
extra-source-files: ChangeLog.md | |
cabal-version: >=1.10 | |
library | |
build-depends: base >=4.10 && <4.11 | |
default-language: Haskell2010 | |
exposed-modules: Lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Lib where | |
foo = 123 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
does_doc_exist() { | |
[ -n "$(find dist-newstyle -name doc -type d)" ] | |
} | |
rm -r dist-newstyle/ | |
cabal new-haddock | |
if does_doc_exist; then | |
echo "==== Running new-haddock on a clean project creates a doc/ directory, OK" | |
else | |
echo "==== Running new-haddock on a clean project does not create a doc/ directory, WAT?" | |
exit 3 | |
fi | |
rm -r dist-newstyle/ | |
cabal new-build | |
if does_doc_exist; then | |
echo "==== After new-build doc/ directory already exists, WAT?" | |
exit 2 | |
else | |
echo "==== After new-build doc/ directory does not exist, OK" | |
fi | |
cabal new-haddock | |
if does_doc_exist; then | |
echo "==== After new-haddock doc/ directory now exists, bug fixed, woo!" | |
exit 0 | |
else | |
echo "==== After new-haddock doc/ directory still does not exist, BUGGY but expected" | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Distribution.Simple | |
main = defaultMain |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment