From b1ed70c939bf3d818710350f45b234b97cf14a80 Mon Sep 17 00:00:00 2001
From: Sean McGinnis <sean.mcginnis@gmail.com>
Date: Thu, 9 Jan 2020 11:56:25 -0600
Subject: [PATCH] Address review comments for make_missing_releases

Fixes some comments from the initial review and minor cleanup.

Change-Id: I17f18f63cb7e9da4bc7504405472e3ac39151c3e
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
---
 tools/make_missing_releases.sh | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/tools/make_missing_releases.sh b/tools/make_missing_releases.sh
index d237258299..77947e4172 100755
--- a/tools/make_missing_releases.sh
+++ b/tools/make_missing_releases.sh
@@ -1,6 +1,7 @@
 #!/usr/bin/env bash
 #
-# Wrapper script to locate run pre-defined queries and if needed create new releases
+# Wrapper script to locate run pre-defined queries and if needed create new
+# releases
 #
 # All Rights Reserved.
 #
@@ -21,7 +22,7 @@ set -e
 function usage {
     echo "Usage: make_missing_releases.sh <series> <stage>"
     echo
-    echo "Valid valules for stage are:"
+    echo "Valid values for stage are:"
     echo "    cwi-m) Used at the m{1,2,3} to run 'interactive release on"
     echo "           cycle-with-intermediary libraries"
     echo
@@ -29,8 +30,8 @@ function usage {
          "needed create new releases"
 }
 
-# Run a command but echo it first, kind of a light-weight set -x but avoids opencoding things
-# and there for glogic errors
+# Run a command but echo it first, kind of a light-weight set -x but avoids
+# opencoding things and there for glogic errors
 function v_run {
     echo "$*"
     "$@"
@@ -41,13 +42,16 @@ if [ $# -lt 2 ]; then
     exit 2
 fi
 
+TOOLSDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+BASEDIR=$(dirname $TOOLSDIR)
+
 # FIXME(tonyb): We *almost* have this in 'functions' update enable_tox_venv()
 # and use that everywhere
 if [[ -z "$VIRTUAL_ENV" ]]; then
     if [[ ! -d .tox/venv ]]; then
-        tox -e venv --notest
+        (cd $BASEDIR && tox -e venv --notest)
     fi
-    source ./.tox/venv/bin/activate
+    source $BASEDIR/.tox/venv/bin/activate
 fi
 
 stable_branch=''