[Gallery] Added platform dependent separator for cross platform compatibility (#285)

Added platform dependent separator for cross platform compatibility.
pull/290/head
Hemant Kumar 5 years ago committed by Per Classon
parent b891c7cc77
commit cd7e52ab88

@ -149,8 +149,9 @@ Future<String> _startProcess(String executable,
/// Return the flutter root path from the environment variables.
String _flutterRootPath() {
final separator = (Platform.isWindows) ? ';' : ':';
final flutterBinPath =
Platform.environment['PATH'].split(':').lastWhere((setting) {
Platform.environment['PATH'].split(separator).lastWhere((setting) {
return path.canonicalize(setting).endsWith(path.join('flutter', 'bin'));
});
return Directory(flutterBinPath).parent.path;

Loading…
Cancel
Save