Skip to content

Commit

Permalink
[web] Silence pub get when it's successful (#44445)
Browse files Browse the repository at this point in the history
In the spirit of keeping the happy path's output as clean as possible, let's hide the many lines printed by `pub get` even when it's successful.

If `pub get` fails, its output will be printed on the terminal.
  • Loading branch information
mdebbar authored Aug 7, 2023
1 parent b5249ed commit dd2405b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion lib/web_ui/dev/felt
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,24 @@ then
FELT_DEBUG_FLAGS="--enable-vm-service --pause-isolates-on-start"
fi

SILENT_LOG=/tmp/felt_pub_get_silent_log.txt
trap "rm -f $SILENT_LOG" EXIT

verbose_on_failure() {
echo "FAILED with the following output:"
cat $SILENT_LOG
exit 1
}

silent_on_success() {
COMMAND=${1+"$@"}
$COMMAND > $SILENT_LOG 2>&1 || verbose_on_failure
}

install_deps() {
# We need to run pub get here before we actually invoke felt.
echo "Running \`dart pub get\` in 'engine/src/flutter/lib/web_ui'"
(cd "$WEB_UI_DIR"; $DART_PATH pub get)
(cd "$WEB_UI_DIR"; silent_on_success $DART_PATH pub get)
}

if [[ $KERNEL_NAME == *"Darwin"* ]]
Expand Down

0 comments on commit dd2405b

Please sign in to comment.