bin: failure containment for st and git-ln

This commit is contained in:
xeruf 2021-07-25 23:51:56 +02:00
parent e7af80f105
commit 283e99ffae
2 changed files with 2 additions and 1 deletions

View File

@ -2,4 +2,4 @@
set -o pipefail set -o pipefail
upCount=$(git rev-list --count HEAD...@{push} 2>/dev/null) upCount=$(git rev-list --count HEAD...@{push} 2>/dev/null)
count=$(expr ${upCount:-0} + 3 \& ${upCount:-0} \> 3 \| 6) 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

View File

@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
# Query local syncthing REST API # Query local syncthing REST API
test $# -eq 0 && echo "Usage: st <command> [args...]" && exit 1
subscript="$(which "$(basename $0)-$1" 2>/dev/null)" subscript="$(which "$(basename $0)-$1" 2>/dev/null)"
if test -f "$subscript" if test -f "$subscript"
then shift && $subscript "$@" then shift && $subscript "$@"