=== modified file 'build' --- build 2017-11-15 00:37:32 +0000 +++ build 2017-11-14 09:47:48 +0000 @@ -1,18 +1,9 @@ #!/bin/zsh -autoload -Uz colors; colors -setopt no_unset warn_create_global extended_glob set -x cd $0:h || exit -# helper that prints out error message and exits -die() { - print -r - "$fg_bold[red]*$reset_color $@" >&2 - exit 1 -} - name=$1 shift -target=$(base64 -w 0 <<<${(j::)${(oq)@}} | tr /+ _-).$name \ - || die "Failed to generate target name" +target=${(j::)${(oq)@}}.$name mkdir -p meta || exit $? redo-ifchange meta/$target === modified file 'common.zsh' --- common.zsh 2017-11-15 00:46:28 +0000 +++ common.zsh 2017-11-15 00:12:49 +0000 @@ -20,15 +20,14 @@ fpath=( $FUNCDIR $fpath ) for f in $FUNCDIR/*(.); do [[ $f:t =~ '^[-_[:alnum:]]*$' ]] || continue - functions[$f:t]='redo-ifchange $FUNCDIR/'$f:t' && autoload -UXz' + functions[$f:t]='redo-ifchange $FUNCDIR/'$f' && autoload -Uz '$f' && '$f' "$@"' done } decode_args() { typeset -gA vars - local arg decoded - decoded=$(tr <<<${BASE##*/} _- /+ | base64 -d) - for arg in "${(s::Q)decoded}"; do + local arg + for arg in "${(s::Q)BASE}"; do if [[ "$arg" != *=* ]]; then echo >&2 "Malformed argument: ${(qqq)arg}" exit 1 @@ -119,15 +118,13 @@ else run=( redo-ifchange ) fi - target=$(base64 -w 0 <<<${(j::)${(oq)new_vars}} | tr /+ _-).$name \ - || die "Failed to generate target name" - "$run[@]" meta/$target || die "Building $name failed ($new_vars)" + target=${(j::)${(oq)new_vars}}.$name + "$run[@]" meta/$target || die "Building $name failed ($target)" if (($#lift)); then - [[ -f meta/$target ]] || die "Building $name produced no output ($new_vars)" # lift %variables from calee to caller local lift_vars arg - for arg in "${(s::Q)$(