File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22# https://github.com/olivergondza/bash-strict-mode
33set -eEuo pipefail
4+ s=declare_out_of_trap_script # Workaround for https://github.com/koalaman/shellcheck/issues/3287
45trap ' s=$?; echo >&2 "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR
56
6- DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " > /dev/null && pwd) "
7-
87function main() {
98 if [[ $# -ne 2 ]]; then
109 echo >&2 " Usage: $0 [IMAGE_A] [IMAGE_B]"
@@ -15,7 +14,7 @@ function main() {
1514
1615 inv_a=" $( mktemp -d gitops-must-gather-A-XXXX) "
1716 inv_b=" $( mktemp -d gitops-must-gather-B-XXXX) "
18- trap " rm -rf ' ${inv_a} ' ' ${inv_b} ' " EXIT
17+ trap ' rm -rf " ${inv_a}" " ${inv_b}" ' EXIT
1918
2019 gather " $img_a " " $inv_a "
2120 gather " $img_b " " $inv_b "
@@ -55,8 +54,10 @@ function sanitize() {
5554 " $dir /oc-adm-output.log" " $dir /must-gather.logs" " $dir /__RESOURCES__/gather.logs" " $dir /__RESOURCES__/gather_gitops.log"
5655
5756 # Timestamps are not going to match, just test there is the same number of them
58- wc -l < " $dir /timestamp" > " $dir /timestamp"
59- wc -l < " $dir /__RESOURCES__/timestamp" > " $dir /__RESOURCES__/timestamp"
57+ ts=" $( wc -l < " $dir /timestamp" ) "
58+ echo " $ts " > " $dir /timestamp"
59+ ts=" $( wc -l < " $dir /__RESOURCES__/timestamp" ) "
60+ echo " $ts " > " $dir /__RESOURCES__/timestamp"
6061}
6162
6263main " $@ "
You can’t perform that action at this time.
0 commit comments