Skip to content

Commit cd7e52a

Browse files
heman4tperclasson
authored andcommitted
[Gallery] Added platform dependent separator for cross platform compatibility (#285)
Added platform dependent separator for cross platform compatibility.
1 parent b891c7c commit cd7e52a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gallery/gallery/tool/grind.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,9 @@ Future<String> _startProcess(String executable,
149149

150150
/// Return the flutter root path from the environment variables.
151151
String _flutterRootPath() {
152+
final separator = (Platform.isWindows) ? ';' : ':';
152153
final flutterBinPath =
153-
Platform.environment['PATH'].split(':').lastWhere((setting) {
154+
Platform.environment['PATH'].split(separator).lastWhere((setting) {
154155
return path.canonicalize(setting).endsWith(path.join('flutter', 'bin'));
155156
});
156157
return Directory(flutterBinPath).parent.path;

0 commit comments

Comments
 (0)