use cursed code style

This commit is contained in:
Connor Olding 2022-09-30 17:17:15 -07:00
parent b531274a13
commit cb705df268
2 changed files with 22 additions and 21 deletions

View File

@ -33,14 +33,14 @@ _temporary_scope_() {
# this doesn't work for all scripts at the moment, but
ADDPATH "$HOME/sh"
(
# combine everything matching "YES_BASH" in ~/sh/ into ~/.sh-bash.
# unlike zsh, we do not check the sha1sum of the output.
cd ~/sh \
&& printf '%s\n' '#!/usr/bin/env false' '[ -n "$preload" ] || exit 1' '' \
| cat - $(grep -lF YES_BASH -- $(find ~/sh/ -maxdepth 1 -type f '!' -name '*.bak')) \
> ~/.sh-bash
)
# combine everything matching "YES_BASH" in ~/sh/ into ~/.sh-bash.
# unlike zsh, we do not check the sha1sum of the output.
(: \
&& cd ~/sh \
&& printf '%s\n' '#!/usr/bin/env false' '[ -n "$preload" ] || exit 1' '' \
| cat - > ~/.sh-bash \
$(grep -lF YES_BASH -- $(find ~/sh/ -maxdepth 1 -type f '!' -name '*.bak')) \
;)
dummy() { :; } ### @- return 0, ignoring arguments.
preload=dummy

View File

@ -58,22 +58,23 @@ autoload edit-command-line
autoload history-search-end
zmodload zsh/mathfunc
function {
local a= b=
# combine everything matching "YES_ZSH" in ~/sh/ into ~/.sh,
# but only recompile the output if the sha1sum has changed.
[ -s ~/.sh.sha1 ] && read -r b _ < ~/.sh.sha1
( cd ~/sh \
# combine everything matching "YES_ZSH" in ~/sh/ into ~/.sh,
# but only recompile the output if the sha1sum has changed.
function
{: \
&& local a= b= \
&& { [ ! -s ~/.sh.sha1 ] || read -r b _ < ~/.sh.sha1 ;} \
&& (: \
&& cd ~/sh \
&& print -l '#!/usr/bin/env false' '[ -n "$preload" ] || exit 1' '' \
| cat - $(grep -lF YES_ZSH -- *~*.bak(.)) \
| tee ~/.sh \
) | sha1sum - \
| tee ~/.sh.sha1 \
| read -r a _
[ "$a" = "$b" ] && touch ~/.sh.zwc || zrecompile -p ~/.sh
}
;) \
| sha1sum - \
| tee ~/.sh.sha1 \
| read -r a _ \
&& { [ "$a" = "$b" ] && touch ~/.sh.zwc || zrecompile -p ~/.sh ;} \
;}
dummy() : ### @- return 0, ignoring arguments.
preload=dummy