Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: v0.6.7
Fetching contributors…

Cannot retrieve contributors at this time

executable file 62 lines (47 sloc) 1.402 kb
#!/bin/bash
#
echo "Have you updated the version number? Type 'yes' if you have!"
read version_response
if [ "$version_response" != "yes" ]; then
echo "Go and update the version number"
exit 1
fi
sdist_output=`runghc Setup.lhs sdist`
if [ "$?" != "0" ]; then
echo "Cabal sdist failed, aborting"
exit 1
fi
# Want to find a line like:
# Source tarball created: dist/ansi-terminal-0.1.tar.gz
# Test this with:
# runghc Setup.lhs sdist | grep ...
filename=`echo $sdist_output | sed 's/.*Source tarball created: \([^ ]*\).*/\1/'`
echo "Filename: $filename"
if [ "$filename" = "$sdist_output" ]; then
echo "Could not find filename, aborting"
exit 1
fi
# Test this with:
# echo dist/ansi-terminal-0.1.tar.gz | sed ...
version=`echo $filename | sed 's/^[^0-9]*\([0-9\.]*\).tar.gz$/\1/'`
echo "Version: $version"
if [ "$version" = "$filename" ]; then
echo "Could not find version, aborting"
exit 1
fi
echo "This is your last chance to abort! I'm going to upload in 10 seconds"
sleep 10
git tag "v$version"
if [ "$?" != "0" ]; then
echo "Git tag failed, aborting"
exit 1
fi
# You need to have stored your Hackage username and password as directed by cabal-upload
# I use -v3 because otherwise the error messages can be cryptic :-)
cabal upload -v3 $filename
if [ "$?" != "0" ]; then
echo "Hackage upload failed, aborting"
exit 1
fi
# Success!
exit 0
Jump to Line
Something went wrong with that request. Please try again.