Unverified Commit 64841f63 authored by Clement Skau's avatar Clement Skau Committed by GitHub

Adds analyze_sample_code exit for when pub fails (#91024)

parent 98120d19
...@@ -121,7 +121,7 @@ Future<void> main(List<String> arguments) async { ...@@ -121,7 +121,7 @@ Future<void> main(List<String> arguments) async {
if (parsedArguments['global-activate-snippets']! as bool) { if (parsedArguments['global-activate-snippets']! as bool) {
try { try {
Process.runSync( final ProcessResult activateResult = Process.runSync(
Platform.resolvedExecutable, Platform.resolvedExecutable,
<String>[ <String>[
'pub', 'pub',
...@@ -132,6 +132,9 @@ Future<void> main(List<String> arguments) async { ...@@ -132,6 +132,9 @@ Future<void> main(List<String> arguments) async {
], ],
workingDirectory: _flutterRoot, workingDirectory: _flutterRoot,
); );
if (activateResult.exitCode != 0) {
exit(activateResult.exitCode);
}
} on ProcessException catch (e) { } on ProcessException catch (e) {
stderr.writeln('Unable to global activate snippets package at version $_snippetsActivateVersion: $e'); stderr.writeln('Unable to global activate snippets package at version $_snippetsActivateVersion: $e');
exit(1); exit(1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment