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 c469f60
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/dns-lists-downloader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,13 @@ 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
echo "${LOG}" | log_lines ERROR
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 c469f60

Please sign in to comment.