# ***************************
# *** Submit to PyPI Test *** 
# ***************************

# Fail on first error:
set -e

# Get the current directory:
OLD_DIR=$(pwd)

# Get the directory where this script is stored:
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"

# Change to the root directory of the map project:
cd $DIR/..

# Register map against PyPI's test server:
echo "Registering map..."
python setup.py register -r pypitest

# Wait a moment:
echo "Waiting a moment before uploading..."
sleep 10

# Upload map to PyPI's test server: 
echo "Uploading map..."
python setup.py sdist upload -r pypitest

# Change back to the original directory:
cd $OLD_DIR
echo "Done."
