Light Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bash-suite/templater

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

5 Commits

Repository files navigation

templater

Very simple templating system that replace {{VAR}} by $VAR environment value

Supports default values by writting {{VAR=value}} in the template

Authors

Based on lavoiesl/bash-templater and other forks

Instalation

To install templater in linux type:

curl -L https://raw.githubusercontent.com/bash-suite/templater/maste r/templater.sh -o /usr/local/bin/templater
chmod +x /usr/local/bin/templater

Usage

# Passing arguments directly
VAR=value templater template

# Evaluate /tmp/foo and pass those variables to the template
# Useful for defining variables in a file
# Parentheses are important for not polluting the current shell
(set -a && . /tmp/foo && templater template)

# A variant that does NOT pass current env variables to the templater
sh -c 'set -a && . /tmp/foo && templater template'
# Read variables from file:
templater template -f variables.txt

# variables.txt
# The author
AUTHOR=Johan
# The version
VERSION=1.2.3
# Don't print any warning messages:
templater template -f variables.txt -s

Examples

See examples/

About

Simple templating system that replaces {{VAR}} by the value of $VAR.

Topics

Resources

Readme

License

MIT license

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

Languages