Skip to content

Commit

Permalink
Workaround to virtual environment's nounset bug.
Browse files Browse the repository at this point in the history
Workaround to pypa/virtualenv#150
  • Loading branch information
b-long committed Dec 11, 2015
1 parent c387f01 commit 20c5cb3
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions run-build-server.sh
Expand Up @@ -7,18 +7,20 @@ err_handler() {

trap 'err_handler $LINENO' ERR

# Fail fast (err_handler above will be invoked)
# Exit immediately if a command exits with a non-zero status.
set -o errexit
# Treat unset variables as an error when substituting.
set -o nounset

# cd to the scripts current directory
cd -P -- "$(dirname -- "$0")"

# As a workaround to https://github.com/pypa/virtualenv/issues/150 , we should
# enable the virtual environment before setting "nounset"
echo "Enabling virtual environment"
source env/bin/activate

# Fail fast (err_handler above will be invoked)
# Exit immediately if a command exits with a non-zero status.
set -o errexit
# Treat unset variables as an error when substituting.
set -o nounset

# TODO: Load variables in a more modular way
echo "Sourcing environment variables"
. workers/static-config.sh
Expand Down

0 comments on commit 20c5cb3

Please sign in to comment.