Skip to content

Commit a2f8676

Browse files
committed
fix: suppress flutter root warning; fix set -e masking grep hints on failure
The "Woah! You appear to be running flutter as root" warning on stderr was filtered out with grep -v in the test/analyze/coverage pipelines. Also fixes a latent bug: set -euo pipefail caused the script to exit immediately on flutter failure, so the "Grep with:" hint was never printed on failure — exactly when it's most needed. Replaced with set -uo pipefail and EXIT_CODE=${PIPESTATUS[0]} to capture flutter's exit code while letting the hint always print.
1 parent 4b342f0 commit a2f8676

3 files changed

Lines changed: 16 additions & 10 deletions

File tree

mise-tasks/analyze.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
#MISE description="Run after Dart changes — pass a path to limit scope; grep output with the path printed at start"
33
#MISE depends=["generate"]
44

5-
set -euo pipefail
5+
set -uo pipefail
66
ANALYZE_LOG="${ANALYZE_LOG:-$(mktemp /tmp/analyze-XXXXXX.log)}"
77
echo "ANALYZE_LOG=$ANALYZE_LOG"
8-
flutter analyze --no-fatal-infos "$@" 2>&1 | tee "$ANALYZE_LOG"
9-
EXIT_CODE=$?
8+
flutter analyze --no-fatal-infos "$@" 2>&1 \
9+
| grep -v -E "Woah! You appear|superuser privileges" \
10+
| tee "$ANALYZE_LOG"
11+
EXIT_CODE=${PIPESTATUS[0]}
1012
echo "---"
1113
echo "Grep with: grep -n 'error\|warning' $ANALYZE_LOG"
12-
exit $EXIT_CODE
14+
exit "$EXIT_CODE"

mise-tasks/coverage.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
#MISE description="Run tests with coverage reporting (output: coverage/lcov.info)"
33
#MISE depends=["generate"]
44

5-
set -euo pipefail
6-
flutter test --coverage
5+
set -uo pipefail
6+
flutter test --coverage 2>&1 | grep -v -E "Woah! You appear|superuser privileges"
7+
EXIT_CODE=${PIPESTATUS[0]}
78
echo "Coverage report generated at coverage/lcov.info"
89
echo "To view HTML report, install lcov and run: genhtml coverage/lcov.info -o coverage/html"
10+
exit "$EXIT_CODE"

mise-tasks/test.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
#MISE description="Run before committing — pass a file arg to run a subset; grep output with the path printed at start"
33
#MISE depends=["generate"]
44

5-
set -euo pipefail
5+
set -uo pipefail
66
TEST_LOG="${TEST_LOG:-$(mktemp /tmp/test-XXXXXX.log)}"
77
echo "TEST_LOG=$TEST_LOG"
8-
flutter test "$@" 2>&1 | tee "$TEST_LOG"
9-
EXIT_CODE=$?
8+
flutter test "$@" 2>&1 \
9+
| grep -v -E "Woah! You appear|superuser privileges" \
10+
| tee "$TEST_LOG"
11+
EXIT_CODE=${PIPESTATUS[0]}
1012
echo "---"
1113
echo "Grep with: grep -n 'FAILED\|ERROR' $TEST_LOG"
12-
exit $EXIT_CODE
14+
exit "$EXIT_CODE"

0 commit comments

Comments
 (0)