Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
jarelllama authored Apr 1, 2024
1 parent 1247c26 commit 99147f2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion functions/check_dead.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ check_dead() {
mv dead.tmp dead_in_raw.tmp

# Remove dead domains from raw file
comm -23 "$RAW" dead_in_raw.tmp > raw.tmp && mv raw.tmp "$RAW"
comm -23 "$RAW" dead_in_raw.tmp > raw.tmp
mv raw.tmp "$RAW"

log_event "$(<dead_in_raw.tmp)" dead raw
}
Expand Down
9 changes: 9 additions & 0 deletions functions/test_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,15 @@ pick_exit() {
[[ "$error" == true ]] && { printf "\n"; exit 1; }
}

check_temp() {
if ! ls x?? &> /dev/null && ! ls ./*.tmp &> /dev/null; then
return
fi
printf "\e[1m[warn] Temporary files were not removed:\e[0m\n"
ls x?? ./*.tmp 2> /dev/null
error=true
}

function check_output {
cmp -s "$1" "$2" && return # Return if files are the same
printf "\e[1m[warn] %s file is not as expected:\e[0m\n" "$3"
Expand Down
3 changes: 2 additions & 1 deletion functions/validate_raw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ validate_raw() {
# Save changes to raw file and raw light file
printf "%s\n" "$domains" > "$RAW"
format_file "$RAW"
comm -12 "$RAW" "$RAW_LIGHT" > light.tmp && mv light.tmp "$RAW_LIGHT"
comm -12 "$RAW" "$RAW_LIGHT" > light.tmp
mv light.tmp "$RAW_LIGHT"

total_whitelisted_count="$(( whitelisted_count + whitelisted_tld_count ))"
after_count="$(wc -l < "$RAW")"
Expand Down

0 comments on commit 99147f2

Please sign in to comment.