Skip to content

jbox-web/envtpl.cr

Repository files navigation

envtpl

envtpl is envtpl in Crystal

envtpl renders Crinja templates on the command line using environment variables.

Installation

Grab the latest binary from the releases page and run it :)

Usage

Usage: envtpl [arguments]
    -i FILE, --in=FILE               Specifies the input file (STDIN by default)
    -o FILE, --out=FILE              Specifies the output file (STDOUT by default)
    -h, --help                       Show this help

Examples

nicolas@laptop:~/PROJECTS/CRYSTAL/envtpl$ echo "Hello: {{ SHELL }}" | bin/envtpl
Hello: /bin/bash
nicolas@laptop:~/PROJECTS/CRYSTAL/envtpl$ echo "Hello: {{ env('SHELL') }}" | bin/envtpl
Hello: /bin/bash
nicolas@laptop:~/PROJECTS/CRYSTAL/envtpl$ echo "Hello: {{ env('SHELL', 'USER') }}" | bin/envtpl
Hello: {'SHELL' => '/bin/bash', 'USER' => 'nicolas'}

Contributing

  1. Fork it (https://github.com/your-github-user/envtpl/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

Similar Tools