From 677ce92bf8aae1b46da305d6c02ffea4aaaab146 Mon Sep 17 00:00:00 2001 From: dadada Date: Tue, 19 Apr 2022 20:15:43 +0200 Subject: [PATCH] update update --- update | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/update b/update index 476cbdb..056fdab 100755 --- a/update +++ b/update @@ -11,7 +11,6 @@ update() { if [ ${status} -ne 0 ]; then echo "Failed to get pad at ${url}" - exit ${status} else git -C "${gitdir}" add "${dst}" changes=$(git -C "${gitdir}" diff --cached | wc -l) @@ -25,6 +24,13 @@ update() { git -C "${gitdir}" reset --hard HEAD } -while read -r pad; do +if ! git rev-parse --is-inside-work-tree +then + echo "Not a working directory" + exit 1 +fi + +while read -r pad +do update "$pad" done