orninject

💉 Orninject – Helps to easily replace environment variables in file

Getting started

Simple replacement way 1

Pipe:

export TITLE=world
echo "Hello " | orninject
$ Hello World

Pipe write:

export TITLE=Hello world
cat index.html
$ <h1></h1>
cat index.html | orninject > index.html
cat index.html
$ <h1>HELLO WORLD</h1>

Simple replacement way 2

File index.html:

<h1></h1>

Command:

export TITLE=Hello world
orninject replace index.html

New index.html content:

<h1>HELLO WORLD</h1>

Advanced replacement

File index.html:

<h1></h1>
<h2></h2>

Command:

export TITLE=Hello world
orninject replace index.html

New index.html content:

<h1>Hello world</h1>
<h2>Default Var Value</h2>

Additional template features

Orninject use text/template and Sprig lib to provide more template features.