From d35ae8e527fa88745eac7c8114680f6f23487a20 Mon Sep 17 00:00:00 2001 From: David Valin Date: Wed, 11 May 2022 14:54:01 -0400 Subject: [PATCH] Fix run dir and test dir --- pyperf/pyperf_run | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/pyperf/pyperf_run b/pyperf/pyperf_run index fe820a8..035d246 100755 --- a/pyperf/pyperf_run +++ b/pyperf/pyperf_run @@ -13,7 +13,7 @@ install_tools() # # Clone the repo that contains the common code and tools # - tools_git=https://github.com/dvalinrh/test_tools + tools_git=https://github.com/redhat-performance/test_tools-wrappers found=0 for arg in "$@"; do @@ -39,7 +39,7 @@ install_tools() # clone the repo. # if [ ! -d "test_tools" ]; then - git clone $tools_git + git clone $tools_git test_tools if [ $? -ne 0 ]; then echo pulling git $tools_git failed. exit @@ -128,9 +128,20 @@ install_tools $0 test_name_run="pyperf" arguments="$@" -chars=`echo $0 | awk -v RS='/' 'END{print NR-1}'` -run_dir=`echo $0 | cut -d'/' -f 1-${chars}` +if [[ $0 == "./"* ]]; then + chars=`echo $0 | awk -v RS='/' 'END{print NR-1}'` + if [[ $chars == 1 ]]; then + run_dir=`pwd` + else + run_dir=`echo $0 | cut -d'/' -f 1-${chars} | cut -d'.' -f2-` + curdir=`pwd` + run_dir="${curdir}${run_dir}" + fi +else + chars=`echo $0 | awk -v RS='/' 'END{print NR-1}'` + run_dir=`echo $0 | cut -d'/' -f 1-${chars}` +fi source test_tools/general_setup "$@"