Usage: string-template '/path/to/%PRJNAME%/'
string-template takes a string as a parameter and looks for occurrences of '%WORD%', replacing that substring with the value of WORD, if it exists in the environment and prints the results to STDOUT.
Example:
PRJNAME=test123 string-template '/path/to/%PRJNAME%
will echo to STDOUT '/path/to/test123'
If WORD does not exist, string-template will print a warning message to STDOUT and replace %WORD% with !!WORD!!.
If WORD does exist but is empty, string-template will replace %WORD% with an empty string.
Install bats along with bats-support, bats-file, and bats-assert to run tests in this repository.