Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jarelllama authored Apr 2, 2024
1 parent cf477da commit e829b3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions functions/retrieve_domains.sh
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ process_source() {
printf "%s\n" "$domains" >> retrieved_light_domains.tmp
fi

# Remove empty lines and count number of filtered domains
filtered_count="$(printf "%s" "$domains" | sed '/^$/d' | wc -w)"
log_source
}
Expand Down Expand Up @@ -234,7 +235,7 @@ build() {
decide_exit
}

# Function 'decide_error' checks if the script should exit with an
# Function 'decide_exit' checks if the script should exit with an
# exit status of 1 or 0.
decide_exit() {
# Exit with error if domains need to be manually reviewed
Expand All @@ -260,7 +261,7 @@ log_source() {
echo "${TIME_FORMAT},${source},${search_term},${unfiltered_count:-0},\
${filtered_count:-0},${total_whitelisted_count},${dead_count:-0},${redundant_count},\
${parked_count:-0},${toplist_count:-0},$(printf "%s" "$domains_in_toplist" | tr '\n' ' '),\
${query_count:-0},${rate_limited:-false}",no >> "$SOURCE_LOG"
${query_count:-0},${rate_limited:-false},no" >> "$SOURCE_LOG"

printf "\n\e[1mSource:\e[0m %s\n" "${item:-$source}"
printf "Raw:%4s Final:%4s Whitelisted:%4s Excluded:%4s Toplist:%4s\n" \
Expand Down
2 changes: 1 addition & 1 deletion functions/test_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ TEST_RETRIEVE_VALIDATE() {
check_output "data/pending/domains_scamadviser.com.tmp" "out_manual_review.txt" "Manual review"

# Check source log
check_terms "$SOURCE_LOG" out_source_log.txt "Source log" || error=true
check_terms "$SOURCE_LOG" out_source_log.txt "Source log"
fi

if [[ "$script_to_test" == 'validate' ]]; then
Expand Down

0 comments on commit e829b3b

Please sign in to comment.