mirror of
https://github.com/chenasraf/dart_script_runner.git
synced 2026-05-18 01:49:04 +00:00
18 lines
524 B
Dart
Executable File
18 lines
524 B
Dart
Executable File
import 'package:script_runner/src/base.dart';
|
|
import 'package:script_runner/src/utils.dart';
|
|
|
|
/// Main entrypoint for CMD script runner.
|
|
Future<void> main(List<String> args) async {
|
|
if (args.isEmpty) {
|
|
printColor('No script command provided. Use -h to see available commands.', [TerminalColor.red]);
|
|
return;
|
|
}
|
|
final scriptCmd = args.first;
|
|
final scriptArgs = args.sublist(1);
|
|
try {
|
|
await runScript(scriptCmd, scriptArgs);
|
|
} catch (e, stack) {
|
|
printColor('$e\n$stack', [TerminalColor.red]);
|
|
}
|
|
}
|