process_run
Process run helpers for Linux/Win/Mac.
shell
Allows to run script from Mac/Windows/Linux in a portable way. Empty lines are added for lisibility
import 'package:process_run/shell.dart';
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
which
Like unix which
, it searches for installed executables
import 'package:process_run/which.dart';
Find flutter
and firebase
executables:
var flutterExectutable = whichSync('flutter');
var firebaseExectutable = whichSync('firebase');
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
MacOS
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
In macos/Runner/DebugProfile.entitlements
and macos/Runner/Release.entitlements
, change:
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
</dict>
to
<dict>
<key>com.apple.security.app-sandbox</key>
<false/>
</dict>
Additional features
Addtional features and information are available here
Libraries
- cmd_run
- Prefer using shell
- dartbin
- Prefer using shell.
- package/package
- process_cmd
- process_run
- Helper to run a process and connect the input/output for verbosity
- shell
- shell_run
- Deprecated in 1.0.0. Prefer using shell in the future
- stdio
- utils/process_result_extension
- utils/shell_bin_command
- which