Merge pull request #1103 from eseidelGoogle/listen_exit

Make `flutter listen` exit nicely when missing dependencies
This commit is contained in:
Eric Seidel 2016-01-06 17:09:56 -08:00
commit 43cd6a0946

View File

@ -45,20 +45,20 @@ class ListenCommand extends StartCommandBase {
try {
runCheckedSync(<String>['which', 'fswatch']);
} catch (e) {
logging.severe('"listen" command is only useful if you have installed '
logging.severe('"listen" command requires '
'fswatch on Mac. Run "brew install fswatch" to install it with '
'homebrew.');
return null;
exit(1);
}
return <String>['fswatch', '-r', '-v', '-1']..addAll(directories);
} else if (Platform.isLinux) {
try {
runCheckedSync(<String>['which', 'inotifywait']);
} catch (e) {
logging.severe('"listen" command is only useful if you have installed '
logging.severe('"listen" requires '
'inotifywait on Linux. Run "apt-get install inotify-tools" or '
'equivalent to install it.');
return null;
exit(1);
}
return <String>[
'inotifywait',