Change-Id: Iee6016757e45c832e8868f0bdcfd4192dd3380c8
Signed-off-by: Klement Sekera <ksekera@cisco.com>
#!/bin/sh
+CMD='git clean -dfX */'
-git pull | grep -q -v 'Already up-to-date.' || git clean -dfX */
+if git pull | grep -v 'Already up-to-date.'
+then
+ echo "Executing $CMD"
+ $CMD
+fi
if [[ "$PRE_EXEC_CMD" != "" ]]
then
echo "Executing \`$PRE_EXEC_CMD' before test.."
- if ! ($PRE_EXEC_CMD 2>$TMP 1>$TMP)
+ if ! ($PRE_EXEC_CMD 2>&1 | tee $TMP)
then
echo "\`$PRE_EXEC_CMD' failed!" >&2
REASON="$PRE_EXEC_CMD failed"
fi
fi
echo -n "Running test iteration #$COUNT..."
- if ! ($CMD 2>$TMP 1>$TMP)
+ if ! ($CMD >$TMP 2>&1)
then
AFTER=`date +%s`
RUNTIME=$((AFTER-BEFORE))