Fix upload script issues
This commit is contained in:
parent
9e9329c784
commit
ab19ea884a
1 changed files with 8 additions and 8 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue