Commit 386c3518 authored by Devon Carew's avatar Devon Carew

improve the failure mode when run from a non-flutter project

fix an issue where errors were printed twice
parent 477530f3
...@@ -6,3 +6,4 @@ ...@@ -6,3 +6,4 @@
build/ build/
packages packages
pubspec.lock pubspec.lock
.atom/
...@@ -192,6 +192,14 @@ class ArtifactStore { ...@@ -192,6 +192,14 @@ class ArtifactStore {
} }
} }
static void ensureHasSkyEnginePackage() {
Directory skyEnginePackage = new Directory(path.join(packageRoot, 'sky_engine'));
if (!skyEnginePackage.existsSync()) {
stderr.writeln("Cannot locate the sky_engine package; did you include 'flutter' in your pubspec.yaml file?");
throw new ProcessExit(2);
}
}
static String _engineRevision; static String _engineRevision;
static String get engineRevision { static String get engineRevision {
...@@ -274,6 +282,7 @@ class ArtifactStore { ...@@ -274,6 +282,7 @@ class ArtifactStore {
} }
static Directory _getCacheDirForPlatform(String platform) { static Directory _getCacheDirForPlatform(String platform) {
ensureHasSkyEnginePackage();
Directory baseDir = _getBaseCacheDir(); Directory baseDir = _getBaseCacheDir();
// TODO(jamesr): Add support for more configurations. // TODO(jamesr): Add support for more configurations.
String config = 'Release'; String config = 'Release';
......
...@@ -144,7 +144,7 @@ class StartCommand extends StartCommandBase { ...@@ -144,7 +144,7 @@ class StartCommand extends StartCommandBase {
await Future.wait([ await Future.wait([
downloadToolchain(), downloadToolchain(),
downloadApplicationPackagesAndConnectToDevices(), downloadApplicationPackagesAndConnectToDevices(),
]); ], eagerError: true);
bool poke = argResults['poke']; bool poke = argResults['poke'];
bool clearLogs = argResults['clear-logs']; bool clearLogs = argResults['clear-logs'];
......
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