Exit early if EMAIL envvar is not defined

announce.sh supposes the EMAIL environment variable is set
(since it calls release-notes without setting it.

Exit early with an error message if it's not set.

Change-Id: Ic9f00478dfeca69c4ecbe5fc126105c445c34c4e
This commit is contained in:
Thierry Carrez 2015-12-08 16:54:09 +01:00
parent 9a0b6dfe22
commit 8ae2e1e84e
2 changed files with 7 additions and 1 deletions

View File

@ -134,7 +134,8 @@ announce.sh
-----------
This script generates an email message ready to be sent to announce
the release of a library or other tool.
the release of a library or other tool. Note that the EMAIL environment
variable needs to be set prior to running the tool.
Example:

View File

@ -33,6 +33,11 @@ REPODIR=$1
VERSION=$2
SHORTNAME=`basename $REPODIR`
if [[ -z "$EMAIL" ]]; then
echo "ERROR: The EMAIL environment variable is not set."
exit 1
fi
if [[ -z "$VIRTUAL_ENV" ]]; then
(cd $TOOLSDIR && tox -e venv --notest)
source $TOOLSDIR/.tox/venv/bin/activate