Fix upload script issues

This commit is contained in:
Julian K. Arni 2015-06-09 12:51:39 +02:00
parent c11012dcbf
commit 9f319963e9

View file

@ -26,13 +26,16 @@ usage () {
upload_package () { upload_package () {
local package="$0" local package="$1"
local cabalFile="$0.cabal" local user="$2"
local pass="$3"
local cabalFile="$package.cabal"
pushd "$package" pushd "$package"
local version=$(grep -i '^version:' $cabalFile | awk '{ print $2 }') local version=$(grep -i '^version:' $cabalFile | awk '{ print $2 }')
local sdist="${package}-${version}.tar.gz" local sdist="dist/${package}-${version}.tar.gz"
cabal sdist cabal sdist
cabal upload --user="$USER" --password="$PASS" "$sdist" echo "User is: $user"
cabal upload --user="$user" --password="$pass" "$sdist"
popd popd
} }
@ -40,13 +43,10 @@ upload_package () {
if [ $# -ne 2 ] ; then if [ $# -ne 2 ] ; then
echo "expecting two arguments." echo "expecting two arguments."
usage usage
else
USER="$0"
PASS="$1"
fi fi
versions_equal versions_equal
for s in ${SOURCES[@]} ; do for s in ${SOURCES[@]} ; do
upload_package "$s" upload_package "$s" "$1" "$2"
done done