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

fix an issue where errors were printed twice
This commit is contained in:
Devon Carew 2016-01-19 09:37:45 -08:00
parent 477530f309
commit 386c351884
3 changed files with 11 additions and 1 deletions

1
packages/.gitignore vendored
View file

@ -6,3 +6,4 @@
build/
packages
pubspec.lock
.atom/

View file

@ -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 get engineRevision {
@ -274,6 +282,7 @@ class ArtifactStore {
}
static Directory _getCacheDirForPlatform(String platform) {
ensureHasSkyEnginePackage();
Directory baseDir = _getBaseCacheDir();
// TODO(jamesr): Add support for more configurations.
String config = 'Release';

View file

@ -144,7 +144,7 @@ class StartCommand extends StartCommandBase {
await Future.wait([
downloadToolchain(),
downloadApplicationPackagesAndConnectToDevices(),
]);
], eagerError: true);
bool poke = argResults['poke'];
bool clearLogs = argResults['clear-logs'];