Skip to content

Commit 6b246f4

Browse files
authored
Merge pull request #2 from redhat-performance/fix_run_dir
Fix run dir and test dir
2 parents 3f43811 + d35ae8e commit 6b246f4

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

pyperf/pyperf_run

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ install_tools()
1313
#
1414
# Clone the repo that contains the common code and tools
1515
#
16-
tools_git=https://github.com/dvalinrh/test_tools
16+
tools_git=https://github.com/redhat-performance/test_tools-wrappers
1717

1818
found=0
1919
for arg in "$@"; do
@@ -39,7 +39,7 @@ install_tools()
3939
# clone the repo.
4040
#
4141
if [ ! -d "test_tools" ]; then
42-
git clone $tools_git
42+
git clone $tools_git test_tools
4343
if [ $? -ne 0 ]; then
4444
echo pulling git $tools_git failed.
4545
exit
@@ -128,9 +128,20 @@ install_tools $0
128128

129129
test_name_run="pyperf"
130130
arguments="$@"
131-
chars=`echo $0 | awk -v RS='/' 'END{print NR-1}'`
132-
run_dir=`echo $0 | cut -d'/' -f 1-${chars}`
133131

132+
if [[ $0 == "./"* ]]; then
133+
chars=`echo $0 | awk -v RS='/' 'END{print NR-1}'`
134+
if [[ $chars == 1 ]]; then
135+
run_dir=`pwd`
136+
else
137+
run_dir=`echo $0 | cut -d'/' -f 1-${chars} | cut -d'.' -f2-`
138+
curdir=`pwd`
139+
run_dir="${curdir}${run_dir}"
140+
fi
141+
else
142+
chars=`echo $0 | awk -v RS='/' 'END{print NR-1}'`
143+
run_dir=`echo $0 | cut -d'/' -f 1-${chars}`
144+
fi
134145

135146
source test_tools/general_setup "$@"
136147

0 commit comments

Comments
 (0)