diff options
| author | John J. Camilleri <john@digitalgrammars.com> | 2020-08-03 14:22:32 +0200 |
|---|---|---|
| committer | John J. Camilleri <john@digitalgrammars.com> | 2020-08-03 14:22:32 +0200 |
| commit | deddde953f9e9b71e35a80bb29af0ce81e1dc6d0 (patch) | |
| tree | dc24c95c8b8cd3855bc90b76a9b8cf48b452f4a9 /src | |
| parent | e10bb790cb257bc025e6256cd8c8a6bbba542754 (diff) | |
Add script for uploading PGF2 documentation to Hackage
Hackage's attempt to build the package will fail because of missing C libraries
Diffstat (limited to 'src')
| -rwxr-xr-x | src/runtime/haskell-bind/stack-haddock-upload.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/runtime/haskell-bind/stack-haddock-upload.sh b/src/runtime/haskell-bind/stack-haddock-upload.sh new file mode 100755 index 000000000..47333bf38 --- /dev/null +++ b/src/runtime/haskell-bind/stack-haddock-upload.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# Author: Dimitri Sabadie <dimitri.sabadie@gmail.com> +# 2015 + +if [ $# -lt 2 ]; then + echo "Usage: ./stack-haddock-upload.sh NAME VERSION" + exit 1 +fi + +dist=`stack path --dist-dir --stack-yaml ./stack.yaml 2> /dev/null` + +echo -e "\033[1;36mGenerating documentation...\033[0m" +stack haddock 2> /dev/null + +if [ "$?" -eq "0" ]; then + docdir=$dist/doc/html + cd $docdir || exit + doc=$1-$2-docs + echo -e "Compressing documentation from \033[1;34m$docdir\033[0m for \033[1;35m$1\033[0m-\033[1;33m$2\033[1;30m" + cp -r $1 $doc + tar -c -v -z --format=ustar -f $doc.tar.gz $doc + echo -e "\033[1;32mUploading to Hackage...\033[0m" + read -p "Hackage username: " username + read -p "Hackage password: " -s password + echo "" + curl -X PUT -H 'Content-Type: application/x-tar' -H 'Content-Encoding: gzip' --data-binary "@$doc.tar.gz" "https://$username:$password@hackage.haskell.org/package/$1-$2/docs" + exit $? +else + echo -e "\033[1;31mNot in a stack-powered project\033[0m" +fi |
