Skip to content

Commit

Permalink
log post download command outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
shizunge committed Jan 23, 2024
1 parent 1db98c2 commit cdf0d16
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/dns-lists-downloader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,14 @@ download_from_single_source_file() {
fi
fix_list "${CURRENT_FILE}"
if [ -n "${POST_DOWNLOAD_CMD}" ]; then
local LOG=
log INFO "Run POST_DOWNLOAD_CMD: ${POST_DOWNLOAD_CMD} ${CURRENT_FILE}"
eval "${POST_DOWNLOAD_CMD} ${CURRENT_FILE}"
if LOG=$(eval "${POST_DOWNLOAD_CMD} ${CURRENT_FILE}" 2>&1); then
echo "${LOG}" | log_lines INFO
else
log WARN "POST_DOWNLOAD_CMD: ${POST_DOWNLOAD_CMD} ${CURRENT_FILE} - returned non-zeor value."
echo "${LOG}" | log_lines WARN
fi
fi
log DEBUG "Merging ${CURRENT_FILE} to ${ACCUMULATOR_FILE}"
# SC2129: Consider using { cmd1; cmd2; } >> file instead of individual redirects.
Expand Down

0 comments on commit cdf0d16

Please sign in to comment.