dotfiles/home/private_dot_config/zsh/functions/envsubst
2023-02-20 10:10:52 -06:00

13 lines
327 B
Bash

##? envsubst - fall-back wrapper in the event the envsubst command does not exist.
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