From 867fe2f8dee092e4034ea32b51eb960bcf585aa3 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sat, 23 Jan 2016 02:42:39 -0500 Subject: use the log functions for errors and status messages This causes the error messages to go to standard error, and it makes it easy to prefix all log messages if desired. --- tools/build_test_env.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'tools') diff --git a/tools/build_test_env.sh b/tools/build_test_env.sh index b71e1bc..aeb199f 100755 --- a/tools/build_test_env.sh +++ b/tools/build_test_env.sh @@ -29,14 +29,14 @@ PY_VER=2 while getopts :p: opt "$@"; do case $opt in p) PY_VER=$OPTARG;; - *) echo "Unknown option: $opt"; exit 1;; + *) fatal "Unknown option: $opt";; esac done case $PY_VER in 2) VENV_CMD=virtualenv;; 3) VENV_CMD=pyvenv;; - *) echo "Wrong python version (2 or 3)"; exit 1;; + *) fatal "Wrong python version (2 or 3)";; esac VENV=$(pwd)/.venv @@ -63,7 +63,7 @@ GREEN='\033[0;32m' NC='\033[0m' OK="echo -e ${GREEN}OK${NC}" -echo -n "Waiting for gitlab to come online... " +log "Waiting for gitlab to come online... " I=0 while :; do sleep 5 @@ -73,7 +73,6 @@ while :; do [ $I -eq 120 ] && exit 1 done sleep 5 -$OK # Get the token TOKEN=$(curl -s http://localhost:8080/api/v3/session \ @@ -92,8 +91,8 @@ url = http://localhost:8080 private_token = $TOKEN EOF -echo "Config file content ($CONFIG):" -cat $CONFIG +log "Config file content ($CONFIG):" +log <$CONFIG $VENV_CMD $VENV . $VENV/bin/activate -- cgit v1.2.1