File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -31,14 +31,15 @@ function doTest() {
3131 diff -u ${REFERENCE} ${OUTPUT}
3232 rc=$?
3333 if [ $rc = 0 ]; then
34- rm -f ${TESTDIR} /. ${name} . *
34+ rm -f ${OUTPUT}
3535 echo " PASS" >&2
3636 elif [ -z $GITHUB_ACTIONS ]; then
3737 read -p " Are these changes expected? [y/N] " EXPECTED
3838 case $EXPECTED in
3939 y* |Y* )
4040 echo " Updating ${REFERENCE} "
4141 cp ${OUTPUT} ${REFERENCE}
42+ rm -f ${OUTPUT}
4243 rc=0
4344 ;;
4445 * ) ;;
@@ -71,24 +72,25 @@ function doTestCompare() {
7172 # Drop the date from the diff output, it will not be stable
7273 diff -u ${TESTDIR} /${name} -naked.expected.yml ${TESTDIR} /${name} -normal.expected.yml | sed ' s/\.yml.*20[0-9][0-9].*/.yml/g' > ${OUTPUT}
7374
74- if [ ! -e ${REFERENCE} ]; then
75+ if [ ! -e ${REFERENCE} -a -z $GITHUB_ACTIONS ]; then
7576 cp ${OUTPUT} ${REFERENCE}
76- echo -e " \n\n#### Created test output\007\n#### Now add ${REFERENCE} to Git\n\n\007 " >&2
77- exit 2
77+ git add ${REFERENCE}
78+ echo -e " \n\n#### Created test output\007\n\n\007 " >& 2
7879 fi
7980
8081 diff -u ${REFERENCE} ${OUTPUT}
8182 rc=$?
8283
8384 if [ $rc = 0 ]; then
84- rm -f ${TESTDIR} /. ${name} . *
85+ rm -f ${OUTPUT}
8586 echo " PASS" >&2
8687 elif [ -z $GITHUB_ACTIONS ]; then
8788 read -p " Are these changes expected? [y/N] " EXPECTED
8889 case $EXPECTED in
8990 y* |Y* )
9091 echo " Updating ${REFERENCE} "
9192 cp ${OUTPUT} ${REFERENCE}
93+ rm -f ${OUTPUT}
9294 rc=0
9395 ;;
9496 * ) ;;
You can’t perform that action at this time.
0 commit comments