File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ Usage: ./psij-ci-run [--help] [--repeat] [--reschedule HH:MM] [--log]
1313 --log
1414 Disables output and redirects to a log instead. Used
1515 when running the tests automatically.
16+ --tee
17+ Logs output as if --log was specified, but also prints
18+ on stdout.
1619EOF
1720}
1821
3437REPEAT=0
3538RESCHEDULE=0
3639NO_OUT=0
40+ TEE=0
3741
3842while [ " $1 " != " " ]; do
3943 case " $1 " in
@@ -54,6 +58,10 @@ while [ "$1" != "" ]; do
5458 NO_OUT=1
5559 shift
5660 ;;
61+ --tee)
62+ TEE=1
63+ shift
64+ ;;
5765 * )
5866 echo " Unrecognized command line option: $1 ."
5967 usage
@@ -62,12 +70,25 @@ while [ "$1" != "" ]; do
6270 esac
6371done
6472
73+ tee () {
74+ while read LINE; do
75+ echo " $LINE " >&3
76+ echo " $LINE " >> ./testing.log
77+ done
78+ }
79+
6580if [ " $NO_OUT " == " 1" ]; then
6681 exec 1< & -
6782 exec 2< & -
6883
6984 exec 1>> ./testing.log
7085 exec 2>&1
86+ elif [ " $TEE " == " 1" ]; then
87+ exec 3>&1 -
88+ exec 2< & -
89+
90+ exec 1> >( tee)
91+ exec 2>&1
7192fi
7293
7394if python --version 2>&1 | egrep -q ' Python 3\..*' > /dev/null 2>&1 ; then
You can’t perform that action at this time.
0 commit comments