A simple Github template that lets you create a kscript repository ready to run and share in a few seconds.
Just click on button to create a new repo starting from this template.
Once created don't forget to update the:
- Script name both the filename and the occurrencies inside the script.
- The script name inside the Github Actions workflow file.
The templated script is just printing the list of files from a input directory. You can use this as a starting point to create your script around it:
- Cli Args parsing with picocli.
- Logging functions
info
,warn
,error
,success
with emoji support โโ ๏ธ โ. - Support for ASCII colored output ๐จ.
- CI Setup with GitHub Actions.
- Publishing of bundled artifact out of the box.
- Issues Template (bug report + feature request).
- Pull Request Template.
This project is using picocli to easily parse the CLI Options and Parameters. You can find more example on how to set up the flags on the official documentation page.
You can use the --help
flag to get a nice report for the available flags:
If you want to see how a failure looks like, invoke with --fail
or -f
:
A couple of util functions are available for logging:
- โน๏ธ
info
to report a info message. You can optionally provide an emoji to enrich the log. - โ
succ
to report a green success message. โ ๏ธ warn
to report a yellow warning message.- โ
error
to report an error. Optionally you can provide also:- A
Throwable
that will be logged on the screen - An exit code
Int
. If not provided the default is1
- A
Calling error
will also stop the script.
This template is using GitHub Actions as CI. You don't need to setup any external service and you should have a running CI once you start using this template.
The workflow Run Script will take care of running the script and publishing the bundled version of it as an artifact (users can easily download it).
Feel free to open a issue or submit a pull request for any bugs/improvements.