From 35de41d6486ebcb7d8dd06eb25ae2a48f416d6b6 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 3 Oct 2016 11:24:18 -0700 Subject: [PATCH] Require the diagnotic-port flag on the flutter skia command (#6174) The diagnostic port forward can be arbitrarily assigned and typically is not the default Fixes https://github.com/flutter/flutter/issues/5867 --- packages/flutter_tools/lib/src/commands/skia.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/flutter_tools/lib/src/commands/skia.dart b/packages/flutter_tools/lib/src/commands/skia.dart index 0f83e2b4e2..859fab487d 100644 --- a/packages/flutter_tools/lib/src/commands/skia.dart +++ b/packages/flutter_tools/lib/src/commands/skia.dart @@ -7,7 +7,6 @@ import 'dart:io'; import 'package:http/http.dart' as http; -import '../base/common.dart'; import '../globals.dart'; import '../runner/flutter_command.dart'; @@ -16,7 +15,6 @@ class SkiaCommand extends FlutterCommand { argParser.addOption('output-file', help: 'Write the Skia picture file to this path.'); argParser.addOption('skiaserve', help: 'Post the picture to a skiaserve debugger at this URL.'); argParser.addOption('diagnostic-port', - defaultsTo: kDefaultDiagnosticPort.toString(), help: 'Local port where the diagnostic server is listening.'); } @@ -45,6 +43,10 @@ class SkiaCommand extends FlutterCommand { printError('Must provide --output-file or --skiaserve'); return 1; } + if (argResults['diagnostic-port'] == null) { + printError('Must provide --diagnostic-port'); + return 1; + } Uri skpUri = new Uri(scheme: 'http', host: '127.0.0.1', port: int.parse(argResults['diagnostic-port']),