Git Product home page Git Product logo

kscript-template's Introduction

kscript-template ๐Ÿ“œ

Use this template Run Script License Language

A simple Github template that lets you create a kscript repository ready to run and share in a few seconds.

How to use ๐Ÿ‘ฃ

Just click on Use this template 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:

Features ๐ŸŽจ

  • 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.

CLI Args โŒจ๏ธ

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:

Logging ๐Ÿ“ฃ

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 is 1

Calling error will also stop the script.

CI โš™๏ธ

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).

Contributing ๐Ÿค

Feel free to open a issue or submit a pull request for any bugs/improvements.

kscript-template's People

Contributors

cortinico avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.