Browse Source

Fix a couple bugs

Thanks, ShellCheck
master
JustAnotherArchivist 1 year ago
parent
commit
a6b8fdaabc
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      codearchiver-bot

+ 5
- 5
codearchiver-bot View File

@@ -135,7 +135,7 @@ function respond {
# Handle marker for end of list job: tell the user it's done and move on.
if [[ "${url}" == 'end' ]]; then
# No status code reflection here because the start of the list job might not even have been in this batch.
respond "${nick}" "Job ${jobid} finished."
respond "${nick}" "Job ${singlejobid} finished."
statuscodes+=(-1)
continue
fi
@@ -143,12 +143,12 @@ function respond {
# Find nonexistent filename for log file (*not* concurrency-safe!)
logbasename="$(date +%Y%m%dT%H%M%SZ)_${singlejobid}"
if [[ -e "${logbasename}_codearchiver.log" ]]; then
for ((i=0; ; ++i)); do
if [[ ! -e "${logbasename}_coll${i}_codearchiver.log" ]]; then
for ((j=0; ; ++j)); do
if [[ ! -e "${logbasename}_coll${j}_codearchiver.log" ]]; then
break
fi
done
logbasename="${logbasename}_coll${i}"
logbasename="${logbasename}_coll${j}"
fi
logname="${logbasename}_codearchiver.log"
artefactsname="${logbasename}_codearchiver_artefacts.txt"
@@ -157,7 +157,7 @@ function respond {
log "Running ${url} (${singlejobid}), logging into ${logname}"
codearchiver --verbose --write-artefacts-fd-3 "${url}" \
2> >(tee "${logname}" | grep -Fv -e ' INFO ' | log_loop "From codearchiver ${singlejobid}: ") \
3> >(tee "${artefactsname}" | log_loop "New artefacts from codearchiver ${singlejob}: ")
3> >(tee "${artefactsname}" | log_loop "New artefacts from codearchiver ${singlejobid}: ")
status="$?"
log "codearchiver ${url} finished with status code ${status}"
statuscodes+=("${status}")


Loading…
Cancel
Save