dfn 0.0.1 dfn: ^0.0.1 copied to clipboard
Use Dart as your scripting language, and register scripts from anywhere.
Example #
Example: #
- Register script(s):
$ dfn config add example # via "package" with a "scripts" directory
Registered 1 new script from /path/to/example/scripts
- hello_from_folder -> /path/to/example/scripts/hello_from_folder.dart
$ dfn config add example/hello_from_standalone.dart
Registered hello_from_standalone
- List all scripts:
$ dfn list
✓ 2 scripts available:
- hello_from_standalone -> /path/to/example/hello_from_standalone.dart
- hello_from_folder -> /path/to/example/scripts
- Run the scripts:
$ dfn hello_from_standalone
Hello from standalone file!
$ dfn hello_from_folder
Hello from script folder!
- Remove the scripts:
$ dfn config rm hello_from_standalone # rm or remove are both valid
Removed: /path/to/example/hello_from_standalone.dart
$ dfn config remove example # need to pass the directory for "packages"
Removed: /path/to/example
- Forward args to
dart run
:
$ dfn test:test test/some_test.dart