tekartik / process_run.dart

Process run helper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is shell.dart support '|'?

gingerjin93 opened this issue · comments

Hi,
When I use '|' in my script, it's run well as a .sh file. But when I ran the same code in shell.dart, I got an error.
The code look like

var shell = Shell();
await shell.run('''
echo Hello
dart --version
cat xcodebuild.log |/usr/local/bin/xcpretty -r json-compilation-database -o compile_commands.json
''');

The error

[]cat: |/usr/local/bin/xcpretty: No such file or directory
cat: -r: No such file or directory
cat: json-compilation-database: No such file or directory
cat: -o: No such file or directory
Unhandled exception:
ShellException(cat xcodebuild.log |/usr/local/bin/xcpretty -r json-compilation-database -o compile_commands.json, 
exitCode 1, workingDirectory: /Users/george/Documents/Workspace/xkit-ios)

And I also try '| grep', the same error.
How can I fix it, many thx!

I resolve this problem by using await process.stdout.pipe(process2.stdin)