fix: correct search in 5.4.5_default_timeout in apply mode (#178)

fixes #116
This commit is contained in:
GoldenKiwi 2023-05-02 17:57:35 +02:00 committed by GitHub
parent ccd9c1a7aa
commit 47cf86237b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,9 +33,9 @@ audit() {
for file_in_dir in $(find "$FILE_SEARCHED" -type f); do for file_in_dir in $(find "$FILE_SEARCHED" -type f); do
does_pattern_exist_in_file "$file_in_dir" "$PATTERN" does_pattern_exist_in_file "$file_in_dir" "$PATTERN"
if [ "$FNRET" != 0 ]; then if [ "$FNRET" != 0 ]; then
debug "$PATTERN is not present in $FILE_SEARCHED/$file_in_dir" debug "$PATTERN is not present in $file_in_dir"
else else
ok "$PATTERN is present in $FILE_SEARCHED/$file_in_dir" ok "$PATTERN is present in $file_in_dir"
SEARCH_RES=1 SEARCH_RES=1
break break
fi fi
@ -45,7 +45,7 @@ audit() {
if [ "$FNRET" != 0 ]; then if [ "$FNRET" != 0 ]; then
debug "$PATTERN is not present in $FILE_SEARCHED" debug "$PATTERN is not present in $FILE_SEARCHED"
else else
ok "$PATTERN is present in $FILES_TO_SEARCH" ok "$PATTERN is present in $FILE_SEARCHED"
SEARCH_RES=1 SEARCH_RES=1
fi fi
fi fi
@ -64,11 +64,11 @@ apply() {
debug "$FILE_SEARCHED is a directory" debug "$FILE_SEARCHED is a directory"
# shellcheck disable=2044 # shellcheck disable=2044
for file_in_dir in $(find "$FILE_SEARCHED" -type f); do for file_in_dir in $(find "$FILE_SEARCHED" -type f); do
does_pattern_exist_in_file "$FILE_SEARCHED/$file_in_dir" "$PATTERN" does_pattern_exist_in_file "$file_in_dir" "$PATTERN"
if [ "$FNRET" != 0 ]; then if [ "$FNRET" != 0 ]; then
debug "$PATTERN is not present in $FILE_SEARCHED/$file_in_dir" debug "$PATTERN is not present in $file_in_dir"
else else
ok "$PATTERN is present in $FILE_SEARCHED/$file_in_dir" ok "$PATTERN is present in $file_in_dir"
SEARCH_RES=1 SEARCH_RES=1
break break
fi fi
@ -78,7 +78,7 @@ apply() {
if [ "$FNRET" != 0 ]; then if [ "$FNRET" != 0 ]; then
debug "$PATTERN is not present in $FILE_SEARCHED" debug "$PATTERN is not present in $FILE_SEARCHED"
else else
ok "$PATTERN is present in $FILES_TO_SEARCH" ok "$PATTERN is present in $FILE_SEARCHED"
SEARCH_RES=1 SEARCH_RES=1
fi fi
fi fi