New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Process.run not working on windows #1191
Comments
Hi @ljoly83 👋 Does your same code work outside the context of a mason hook? |
Hi @felangel
|
I don't think you need cmd.exe import 'dart:io';
import 'package:mason/mason.dart';
void run(HookContext context) async {
String output = 'Test_2';
var result0 = await Process.run('', ['echo', 'Test', '0'], runInShell: true);
var result1 = await Process.run('echo', ['Test 1'], runInShell: true);
var result2 =
await Process.run('echo', [output, '$output'], runInShell: true);
stdout.write(result0.stdout);
stdout.write(result1.stdout);
stdout.write(result2.stdout);
}
*** Result *** |
Description
I want to use Process.run on Windows, but I can't manage to make it work.
Steps To Reproduce
In my post_gen.dart:
var result = await Process.run('cmd.exe', ['echo test'], runInShell: true);
stdout.write(result.stdout);
stderr.write(result.stderr);
Expected Behavior
echo the test
** Result **
Microsoft Windows [version 10.0.22621.2861]
(c) Microsoft Corporation. Tous droits r‚serv‚s.
The text was updated successfully, but these errors were encountered: