]> git.immae.eu Git - github/fretlink/text-pipes.git/blame - Fu.sh
omit >->/map rules
[github/fretlink/text-pipes.git] / Fu.sh
CommitLineData
57454c33 1#!/usr/bin/env bash
2cabal configure && cabal build && cabal haddock --hyperlink-source \
3 --html-location='/package/$pkg-version/docs' \
4 --contents-location='/package/$pkg'
5S=$?
6if [ "${S}" -eq "0" ]; then
7 cd "dist/doc/html"
8 DDIR="${1}-${2}-docs"
9 cp -r "${1}" "${DDIR}" && tar -c -v -z --format=ustar -f "${DDIR}.tar.gz" "${DDIR}"
10 CS=$?
11 if [ "${CS}" -eq "0" ]; then
12 echo "Uploading to Hackageā€¦"
13 curl -X PUT -H 'Content-Type: application/x-tar' -H 'Content-Encoding: gzip' --data-binary "@${DDIR}.tar.gz" "http://${3}:${4}@hackage.haskell.org/package/${1}-${2}/docs"
14 exit $?
15 else
16 echo "Error when packaging the documentation"
17 exit $CS
18 fi
19else
20 echo "Error when trying to build the package."
21 exit $S
22fi