From 283e99ffae3dab257bcdf4efcf71385ad7bdf54c Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Sun, 25 Jul 2021 23:51:56 +0200 Subject: [PATCH] bin: failure containment for st and git-ln --- .local/bin/scripts/git-ln | 2 +- .local/bin/scripts/st | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.local/bin/scripts/git-ln b/.local/bin/scripts/git-ln index 2678235..85f0465 100755 --- a/.local/bin/scripts/git-ln +++ b/.local/bin/scripts/git-ln @@ -2,4 +2,4 @@ set -o pipefail upCount=$(git rev-list --count HEAD...@{push} 2>/dev/null) count=$(expr ${upCount:-0} + 3 \& ${upCount:-0} \> 3 \| 6) -git --no-pager lo -$count --color=always --graph HEAD @{push} | head -9 || git --no-pager lo -7 +git --no-pager lo -$count --color=always --graph HEAD @{upstream} | head -9 || git --no-pager lo -7 diff --git a/.local/bin/scripts/st b/.local/bin/scripts/st index c19c649..bb1e143 100755 --- a/.local/bin/scripts/st +++ b/.local/bin/scripts/st @@ -1,5 +1,6 @@ #!/bin/sh # Query local syncthing REST API +test $# -eq 0 && echo "Usage: st [args...]" && exit 1 subscript="$(which "$(basename $0)-$1" 2>/dev/null)" if test -f "$subscript" then shift && $subscript "$@"