X Tutup
Skip to content

Commit 4927fbf

Browse files
committed
updated tests/utils.sh
1 parent 7aa94d5 commit 4927fbf

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/utils.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env bash
2+
# shellcheck disable=SC1090
23
# vim:ts=4:sts=4:sw=4:et
34
#
45
# Author: Hari Sekhon
@@ -28,11 +29,13 @@ export COMPOSE_PROJECT_NAME="pytools"
2829
if [ -n "${TRAVIS:-}" ]; then
2930
sudo=sudo
3031
else
32+
# will be used in sourcing scripts
33+
# shellcheck disable=SC2034
3134
sudo=""
3235
fi
3336

3437
set +o pipefail
35-
spark_home="$(ls -d tests/spark-*-bin-hadoop* 2>/dev/null | head -n 1)"
38+
spark_home="$(find . -type d -path 'tests/spark-*-bin-hadoop*' 2>/dev/null | head -n 1)"
3639
set -o pipefail
3740
if [ -n "$spark_home" ]; then
3841
export SPARK_HOME="$spark_home"
@@ -56,7 +59,7 @@ sample_files(){
5659
"$data_dir/../../README.md" \
5760
; do
5861
local excluded=0
59-
for ext in $@; do
62+
for ext in "$@"; do
6063
if [ "${filename##*.}" = "$ext" ]; then
6164
excluded=1
6265
break
@@ -69,9 +72,9 @@ sample_files(){
6972
}
7073

7174
check_broken_sample_files(){
72-
echo "Now checking non $@ files to detect successful failure:"
75+
echo "Now checking non $* files to detect successful failure:"
7376
echo
74-
for filename in $(sample_files $@); do
77+
for filename in $(sample_files "$@"); do
7578
check_broken "$filename"
7679
done
7780
}

0 commit comments

Comments
 (0)
X Tutup