27 lines
895 B
Bash
Executable File
27 lines
895 B
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
REPORT_DIR=$(dirname -- "$(readlink -f -- "${BASH_SOURCE[0]}")")
|
|
source "$REPORT_DIR/paste_log.sh"
|
|
output=
|
|
upload=1
|
|
args=()
|
|
while (($#)); do
|
|
case $1 in
|
|
--output) [[ $# -ge 2 ]] || exit 2; output=$2; shift 2 ;;
|
|
--no-upload) upload=0; shift ;;
|
|
--timeout) [[ $# -ge 2 ]] || exit 2; args+=("--timeout" "$2"); shift 2 ;;
|
|
-h|--help)
|
|
echo "Usage: $0 [--output DIRECTORY] [--no-upload] [--timeout SECONDS]"
|
|
echo 'Collect diagnostics, build an HTML cover page and individual text files, then upload.'
|
|
exit 0 ;;
|
|
*) echo "Unknown argument: $1" >&2; exit 2 ;;
|
|
esac
|
|
done
|
|
if [[ -z $output ]]; then
|
|
output=$(mktemp -d "./kent-report-$(date +%Y%m%d-%H%M%S)-XXXXXXXX")
|
|
fi
|
|
python3 "$REPORT_DIR/kent_report.py" --output "$output" "${args[@]}"
|
|
if ((upload)); then
|
|
paste_directory "$output"
|
|
fi
|