Don't show 'precompiling' from `global run` unless in terminal (#2687)

diff --git a/lib/src/command/global_run.dart b/lib/src/command/global_run.dart
index 25a2faa..78dcd69 100644
--- a/lib/src/command/global_run.dart
+++ b/lib/src/command/global_run.dart
@@ -70,7 +70,8 @@
         Executable.adaptProgramName(package, executable), args,
         vmArgs: vmArgs,
         enableAsserts: argResults['enable-asserts'] || argResults['checked'],
-        recompile: globalEntrypoint.precompileExecutable);
+        recompile: (executable) => log.warningsOnlyUnlessTerminal(
+            () => globalEntrypoint.precompileExecutable(executable)));
     await flushThenExit(exitCode);
   }
 }
diff --git a/test/global/binstubs/outdated_binstub_runs_pub_global_test.dart b/test/global/binstubs/outdated_binstub_runs_pub_global_test.dart
index 16e4f0e..52738ec 100644
--- a/test/global/binstubs/outdated_binstub_runs_pub_global_test.dart
+++ b/test/global/binstubs/outdated_binstub_runs_pub_global_test.dart
@@ -93,12 +93,7 @@
         ['arg1', 'arg2'],
         environment: getEnvironment());
 
-    expect(
-        await process.stdout.rest.toList(),
-        allOf([
-          contains('Precompiled foo:script.'),
-          contains('ok [arg1, arg2]')
-        ]));
+    expect(await process.stdout.rest.toList(), contains('ok [arg1, arg2]'));
 
     expect(
       binStub('foo-script'),