Skip to content

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

License

Notifications You must be signed in to change notification settings

bash-suite/templater

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

templater

License: MIT

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/master/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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages