Commit 3a2aa890 authored by Eric Seidel's avatar Eric Seidel

Make `flutter listen` exit nicely when missing dependencies

Previously it died with a confusing exception.

@chinmaygarde
parent e1b16729
...@@ -45,20 +45,20 @@ class ListenCommand extends StartCommandBase { ...@@ -45,20 +45,20 @@ class ListenCommand extends StartCommandBase {
try { try {
runCheckedSync(<String>['which', 'fswatch']); runCheckedSync(<String>['which', 'fswatch']);
} catch (e) { } 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 ' 'fswatch on Mac. Run "brew install fswatch" to install it with '
'homebrew.'); 'homebrew.');
return null; exit(1);
} }
return <String>['fswatch', '-r', '-v', '-1']..addAll(directories); return <String>['fswatch', '-r', '-v', '-1']..addAll(directories);
} else if (Platform.isLinux) { } else if (Platform.isLinux) {
try { try {
runCheckedSync(<String>['which', 'inotifywait']); runCheckedSync(<String>['which', 'inotifywait']);
} catch (e) { } 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 ' 'inotifywait on Linux. Run "apt-get install inotify-tools" or '
'equivalent to install it.'); 'equivalent to install it.');
return null; exit(1);
} }
return <String>[ return <String>[
'inotifywait', 'inotifywait',
......
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