docker-hs/scripts/hackage-docs.sh
Deni Bertovic 6b7c1d2a38 Adds script for building docs.
It would be nice if stack did this automatically.
2016-09-07 16:45:15 +02:00

23 lines
653 B
Bash
Executable File

#!/bin/bash
# Run this script in the top-level of your package directory
# (where the .cabal file is) to compile documentation and
# upload it to hackage.
# Requirements:
# cabal-install-1.24 (for --for-hackage)
# haddock 2.17 (for the hyperlinked source)
set -e
VERSION=`grep "^version:" docker.cabal | cut -d " " -f14`
BUILDDIR=dist-newstyle/build/docker-$VERSION
DOCSDIRNAME=docker-$VERSION-docs
cabal act-as-setup -- haddock --builddir=$BUILDDIR --for-hackage --hyperlink-sources
cd $BUILDDIR/doc/html && tar --format=ustar -zcvf $DOCSDIRNAME.tar.gz $DOCSDIRNAME
echo NOW RUN: \n\n
echo cabal upload -d $BUILDDIR/doc/html/$DOCSDIRNAME.tar.gz