shell_cmd 0.1.0 copy "shell_cmd: ^0.1.0" to clipboard
shell_cmd: ^0.1.0 copied to clipboard

A library for running programs either explicitly or in shell

example/shell_cmd_example.dart

import 'dart:io';

import 'package:shell_cmd/shell_cmd.dart';

Future<void> main() async {
  print('\nOS: ${Platform.operatingSystemVersion}');
  print('\nIsWindows: ${ShellCmd.isWindows}');
  print('\nDefShell: ${ShellCmd.getShell()}');

  final cmd =
      (ShellCmd.isWindows ? 'echo. & echo %CD%' : 'echo "" && echo `pwd`');
  final r = await ShellCmd.run(cmd, runInShell: true);

  print('\nSplit: ${ShellCmd.split(cmd)}');
  print(
      '\nCurDir:\n${r.exitCode == 0 ? 'Success' : 'Error ${r.exitCode}'}\n${r.stdout.toString()}***');
}
0
likes
0
pub points
54%
popularity

Publisher

verified publisheraiurovet.com

A library for running programs either explicitly or in shell

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

charcode, path, string_scanner

More

Packages that depend on shell_cmd