diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-10-04 02:55:34 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-10-04 02:55:34 +0200 |
commit | 8f5de091611886c8d2feb4d2bd0f1ddcb9419cac (patch) | |
tree | 17af33e8db0c16a434486fd86340e33d3ec4e21e /bin | |
parent | bdfb02015178aabdb80320e9355fb33517c7f240 (diff) | |
parent | 5a8c1637d56e430f6d80e2b27e28f31cf21687dd (diff) |
Merge branch 'main' of db:dotfiles
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/extra/supd | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/bin/extra/supd b/bin/extra/supd index a383d65..83a606b 100755 --- a/bin/extra/supd +++ b/bin/extra/supd @@ -1,6 +1,13 @@ #!/bin/sh -usage() { >&2 printf "usage: supd\nusage: supd <prefix> <dir>"; exit 1; } +usage() { + >&2 cat <<-EOF + usage: supd + supd <prefix> <dir> + stdout | supd <prefix> + EOF + exit 1 +} check () { @@ -12,8 +19,8 @@ check () printf 'Up to date.' || printf 'Couldn'\''t update.' printf ' ' - git status --short 2> /dev/null | head -n1 | awk '{print $1 " "}' - printf '\n' + printf '%s\n' "$(git status --short 2> /dev/null | + awk 'NR==1 {print $1}')" done } @@ -21,6 +28,10 @@ if [ "$#" -eq 0 ] then dirs="installdrier dotfiles password-store" prefix="$HOME/src" +elif [ ! -t 0 ] +then + prefix="$1" + dirs="$(cat)" else prefix="$1" shift || usage |