Skip to content

Commit

Permalink
fix: make command run for Windows in shell due to specific behavior o…
Browse files Browse the repository at this point in the history
…f `Process.start` for Windows

[Windows issues of running flutterw](hyiso#19)
  • Loading branch information
vvvictor07 committed Apr 10, 2024
1 parent dfe70bf commit 66a7750
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/flutterw/lib/src/shell.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Future<int> runFlutter(List<String> arguments) async {
final process = await Process.start(
'flutter',
arguments,
runInShell: Platform.isWindows,
mode: ProcessStartMode.inheritStdio,
);
final code = await process.exitCode;
Expand Down Expand Up @@ -40,6 +41,7 @@ Future<int> runShells(
final process = await Process.start(
cmds.removeAt(0),
cmds,
runInShell: Platform.isWindows,
mode: isVerbose ? ProcessStartMode.inheritStdio : ProcessStartMode.normal,
);
final code = await process.exitCode;
Expand Down
8 changes: 6 additions & 2 deletions packages/flutterw_build_aar/bin/flutterw_build_aar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ void main(List<String> arguments) async {
arguments.replaceRange(
index + 1, index + 2, [pubspec.version!.canonicalizedVersion]);
}
final process = await Process.start('flutter', ['build', 'aar', ...arguments],
mode: ProcessStartMode.inheritStdio);
final process = await Process.start(
'flutter',
['build', 'aar', ...arguments],
runInShell: Platform.isWindows,
mode: ProcessStartMode.inheritStdio,
);
exitCode = await process.exitCode;
}

0 comments on commit 66a7750

Please sign in to comment.