Created
June 14, 2015 20:48
-
-
Save bergmark/a1ae07db804d20280d7a to your computer and use it in GitHub Desktop.
This file contains hidden or 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/bash | |
| cabal configure && cabal build && cabal haddock --hyperlink-source --html-location='http://localhost:8080/package/$pkg/docs' --contents-location='http://localhost:8080/package/$pkg' | |
| S=$? | |
| if [ "${S}" -eq "0" ]; then | |
| cd "dist/doc/html" | |
| DDIR="${1}-${2}-docs" | |
| cp -r "${1}" "${DDIR}" && tar -c -v -z --format=ustar -f "${DDIR}.tar.gz" "${DDIR}" | |
| CS=$? | |
| if [ "${CS}" -eq "0" ]; then | |
| echo "Uploading to Hackage…" | |
| curl -X PUT -H 'Content-Type: application/x-tar' -H 'Content-Encoding: gzip' --data-binary "@${DDIR}.tar.gz" "http://${3}:${4}@localhost:8080/package/${1}-${2}/docs" -u adam | |
| exit $? | |
| else | |
| echo "Error when packaging the documentation" | |
| exit $CS | |
| fi | |
| else | |
| echo "Error when trying to build the package." | |
| exit $S | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment