From 4358550651cc8408a0d6409a14bebf56c85b68f1 Mon Sep 17 00:00:00 2001 From: Jarell <91372088+jarelllama@users.noreply.github.com> Date: Tue, 2 Apr 2024 12:21:15 +0800 Subject: [PATCH] Update --- functions/check_dead.sh | 1 - functions/check_parked.sh | 1 - functions/test_functions.sh | 10 +++++----- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/functions/check_dead.sh b/functions/check_dead.sh index 209d74e2b..c7795bc9a 100644 --- a/functions/check_dead.sh +++ b/functions/check_dead.sh @@ -143,7 +143,6 @@ check_alive() { # $1: file to process # Output: # dead.tmp -# exit status 0 (if dead domains found) # exit status 1 (if dead domains not found) find_dead() { sed 's/^/||/; s/$/^/' "$1" > formatted_domains.tmp diff --git a/functions/check_parked.sh b/functions/check_parked.sh index 45ada87f8..eb67b3e55 100644 --- a/functions/check_parked.sh +++ b/functions/check_parked.sh @@ -64,7 +64,6 @@ add_unparked_domains() { # $1: file to process # Output: # parked_domains.tmp -# exit status 0 (if parked domains found) # exit status 1 (if parked domains not found) retrieve_parked() { # Truncate temporary files between runs diff --git a/functions/test_functions.sh b/functions/test_functions.sh index 926638a49..392eb08c1 100644 --- a/functions/test_functions.sh +++ b/functions/test_functions.sh @@ -127,6 +127,9 @@ TEST_RETRIEVE_VALIDATE() { mv xab data/pending/domains_google_search_search-term-1.tmp mv xac data/pending/domains_google_search_search-term-2.tmp + # Prepare sample raw light file + cp "$RAW" "$RAW_LIGHT" + # Run retrieval script run_script retrieve_domains.sh fi @@ -135,7 +138,7 @@ TEST_RETRIEVE_VALIDATE() { if [[ "$script_to_test" == 'validate' ]]; then # Use input.txt as sample raw files to test cp input.txt "$RAW" - cp input.txt "$RAW_LIGHT" + cp "$RAW" "$RAW_LIGHT" # Expected output for light version cp out_raw.txt out_raw_light.txt @@ -487,7 +490,6 @@ test_source_log() { # TEST: exclusion of specific sources from light version test_light_build() { - cp "$RAW" "$RAW_LIGHT" # INPUT printf "raw-light-test.com\n" >> data/pending/domains_guntab.com.tmp # EXPECTED OUTPUT @@ -600,9 +602,7 @@ run_script() { printf "%s\n" "----------------------------------------------------------------------" # Return 1 if script has an exit status of 1 - if [[ "$errored" == true ]]; then - return 1 - fi + [[ "$errored" == true ]] && return 1 || return 0 } # Function 'check_and_exit' is a shell wrapper that checks if the script