diff options
author | Eric Ball <eball@linuxfoundation.org> | 2022-04-05 15:54:50 -0700 |
---|---|---|
committer | Eric Ball <eball@linuxfoundation.org> | 2022-04-05 15:58:35 -0700 |
commit | 715bbc203cf486bc268aa6c4181beba3e1acb975 (patch) | |
tree | 2cf6215296eddbf1b17c98eed513d86f25913b4d | |
parent | 5532c8c0101ac6f3643e39f214e49fa2f86e3001 (diff) |
Fix tox test loop in mvn-phase-script.sh
This loop was not running correctly, because the find results were
being returned as a string rather than an array. The results always
contain a newline, and the complicated rev-cut-rev script seems to
be a workaround that fails if the wrong result is shown first.
By adding parentheses around the TOXINIS assignment command, the
results are returned as an array. We can then simply use bash's
dirname command to get the parent directory.
Issue-ID: MODELING-604
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
Change-Id: I0881958395c7104f263928a3c4394fd141b79208
-rwxr-xr-x | mvn-phase-script.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mvn-phase-script.sh b/mvn-phase-script.sh index 13b755e..ab8155e 100755 --- a/mvn-phase-script.sh +++ b/mvn-phase-script.sh @@ -50,9 +50,9 @@ run_tox_test() if [[ ${CURDIR} =~ "-sonar" ]] then echo "====Sonar job, need execute tox." - TOXINIS=$(find . -name "tox.ini") + TOXINIS=($(find . -name "tox.ini")) for TOXINI in "${TOXINIS[@]}"; do - DIR=$(echo "$TOXINI" | rev | cut -f3- -d'/' | rev) + DIR=$(dirname "$TOXINI") cd "${CURDIR}/${DIR}" rm -rf ./venv-tox ./.tox virtualenv ./venv-tox |