From 103a4e73df0b44d30b0dabe40087c5f9f4c42aae Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sun, 18 Feb 2024 22:39:07 +0300 Subject: [PATCH] Trivial style fixes --- contrib/paster.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/paster.zsh b/contrib/paster.zsh index 76f1464..34a5cf5 100755 --- a/contrib/paster.zsh +++ b/contrib/paster.zsh @@ -1,20 +1,20 @@ #!/usr/bin/env zsh -set -e +setopt ERR_EXIT DST=${DST:-paster.example.com 2020} ext="0:," -[[ -s "$1" ]] && { +if [[ -s "$1" ]] ; then src="$1" bn=$src:t e=${bn##*.} [[ $bn = $e ]] || ext="${#e}:$e," -} || { +else src=`mktemp` trap "rm -f $src" HUP PIPE INT QUIT TERM EXIT cat > $src [[ $# -eq 0 ]] || ext="${#1}:$1," -} +fi zmodload -F zsh/stat b:zstat size=`zstat +size $src` -- 2.44.0