check for lacking shebang line, only
This commit is contained in:
parent
32a2247292
commit
ceaf1bc92d
14
urchin
14
urchin
@ -192,8 +192,7 @@ recurse() {
|
|||||||
start=$(date +%s)
|
start=$(date +%s)
|
||||||
set +e
|
set +e
|
||||||
{
|
{
|
||||||
if $cycle_shell &&
|
if $cycle_shell && ! has_shebang_line "$potential_test"; then
|
||||||
has_sh_or_no_shebang_line "$potential_test"; then
|
|
||||||
TEST_SHELL="$the_test_shell" $TIMEOUT \
|
TEST_SHELL="$the_test_shell" $TIMEOUT \
|
||||||
"$the_test_shell" "$potential_test"
|
"$the_test_shell" "$potential_test"
|
||||||
else
|
else
|
||||||
@ -362,15 +361,8 @@ report_outcome() {
|
|||||||
test "$not_oks" -eq '0'
|
test "$not_oks" -eq '0'
|
||||||
}
|
}
|
||||||
|
|
||||||
has_sh_or_no_shebang_line() {
|
has_shebang_line() {
|
||||||
# no shebang line at all
|
head -n 1 "$1" | grep -qE '^#!'
|
||||||
head -n 1 "$1" | grep -vqE '^#!' && return 0
|
|
||||||
|
|
||||||
# shebang line is '#!/bin/sh' or legal variations thereof
|
|
||||||
head -n 1 "$1" | grep -qE '^#![[:blank:]]*/bin/sh($|[[:blank:]])' &&
|
|
||||||
return 0
|
|
||||||
|
|
||||||
return 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
USAGE="usage: $0 [<options>] <test directory>"
|
USAGE="usage: $0 [<options>] <test directory>"
|
||||||
|
Loading…
Reference in New Issue
Block a user