-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
module docs + added a script to generate haddocks
- Loading branch information
Frank Staals
authored and
Frank Staals
committed
Jun 11, 2016
1 parent
514c1c9
commit 7b58195
Showing
3 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/sh | ||
# Based on https://gist.github.com/Fuuzetsu/8276421 | ||
# Usage: sh hackagedocs.sh 0.7.1 UserName Password | ||
PKG_NAME=hgeometry | ||
|
||
stack configure && stack build && stack haddock --hyperlink-source --html-location='http://hackage.haskell.org/package/$pkg/docs' \ | ||
--contents-location='http://hackage.haskell.org/package/$pkg' | ||
S=$? | ||
if [ "${S}" -eq "0" ]; then | ||
cd "dist/doc/html" | ||
DDIR="${PKG_NAME}-${1}-docs" | ||
cp -r "${PKG_NAME}" "${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://${2}:${3}@hackage.haskell.org/package/${PKG_NAME}-${1}/docs" | ||
exit $? | ||
else | ||
echo "Error when packaging the documentation" | ||
exit $CS | ||
fi | ||
else | ||
echo "Error when trying to build the package." | ||
exit $S | ||
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
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