15 lines
353 B
Bash
15 lines
353 B
Bash
##? envsubst - fall-back wrapper in the event the envsubst command does not exist.
|
|
|
|
# function envsubst {
|
|
if (( ! $+commands[envsubst] )); then
|
|
function envsubst {
|
|
command envsubst "$@"
|
|
}
|
|
else
|
|
function envsubst {
|
|
python -c 'import os,sys;[sys.stdout.write(os.path.expandvars(l)) for l in sys.stdin]'
|
|
}
|
|
fi
|
|
# }
|
|
|
|
# vim: ft=zsh sw=2 ts=2 et
|