[shtpl] Bug corrections

This commit is contained in:
dig 2019-07-26 13:35:09 +02:00
parent d0bf795dc7
commit a1b92ff78a
1 changed files with 3 additions and 5 deletions

View File

@ -79,7 +79,7 @@ param()
# debug name value # debug name value
params[$name]="${value:-true}" params[$name]="${value:-true}"
case "$name" in case "$name" in
h|help) need_help=true; params[h]="${value:-true}"; params[help]="${value:-true}" ;; h|help) need_help=true; params[h]="${value:-true}"; params[help]="${value:-true}" ;;
v|verbose) _verbose=true; params[v]="${value:-true}"; params[verbose]="${value:-true}" ;; v|verbose) _verbose=true; params[v]="${value:-true}"; params[verbose]="${value:-true}" ;;
p|pipable) isPipable=true; params[p]="${value:-true}"; params[pipable]="${value:-true}" ;; p|pipable) isPipable=true; params[p]="${value:-true}"; params[pipable]="${value:-true}" ;;
esac esac
@ -116,7 +116,7 @@ debug args opts mandatories envs params file need_help _verbose isPipable
__shtpl_path__=$(realpath $0) __shtpl_path__=$(realpath $0)
__shtpl_dir__=$(dirname $0) __shtpl_dir__=$(dirname $0)
__tpl_path__=$(realpath $1) __tpl_path__=$(realpath $file)
__tpl_name__=$(basename $__tpl_path__) __tpl_name__=$(basename $__tpl_path__)
__tpl_dir__=$(dirname $__tpl_path__) __tpl_dir__=$(dirname $__tpl_path__)
@ -148,11 +148,9 @@ slug()
# Execution # Execution
eval "echo \"$(cat $1 | sed ' eval "echo \"$(cat $file | sed '
# Suppress hashbang # Suppress hashbang
1{ /#\!.*shtpl.*/ d } 1{ /#\!.*shtpl.*/ d }
# Excape quotes # Excape quotes
s/"/\\"/g s/"/\\"/g
')\"" ')\""