zshrepo/functions/envsubst
Jochen Maes 98b5f34043 initial commit
Signed-off-by: Jochen Maes <jochen@sejo-it.be>
2023-11-27 07:48:55 +01:00

11 lines
276 B
Bash

#!/bin/zsh
##? envsubst - fall-back wrapper in the event the envsubst command does not exist.
#function envsubst {
if (( $+commands[envsubst] )); then
command envsubst "$@"
else
python -c 'import os,sys;[sys.stdout.write(os.path.expandvars(l)) for l in sys.stdin]'
fi
#}