process_run 0.12.3+2 process_run: ^0.12.3+2 copied to clipboard
Process run helpers for Linux/Win/Mac and which like feature for finding executables.
Process run helpers for Linux/Win/Mac.
Process.run does not stream output which is not convenient for lengthy
operation. It requires using
Process.start in a more complex way.
runCmd add verbose helper for that. Also dart binaries (pub, dart2js...) and any
script can be called consistently on Mac/Windows/Linux
ProcessCmd allow creating command object that can be run and modified.
which, it searches for installed executables
var flutterExectutable = whichSync('flutter'); var firebaseExectutable = whichSync('firebase');
Allows to run script from Mac/Windows/Linux in a portable way. Empty lines are added for lisibility
Run a simple script:
var shell = Shell(); await shell.run(''' # Display some text echo Hello # Display dart version dart --version # Display pub version pub --version ''');
More information on shell here
shell bin utility #
Binary utility that allow changing from the command line the environment (var, path, alias) used in Shell.
More information on shell bin here
Flutter context #
If you want to run executable in a MacOS flutter context, you need to disable sandbox mode. See Removing sandboxing and ProcessException: Operation not permitted on macOS
<dict> <key>com.apple.security.app-sandbox</key> <true/> </dict>
<dict> <key>com.apple.security.app-sandbox</key> <false/> </dict>
Additional features #
Addtional features and information are available here