From c9f27cbaa50054fd47289df4ce33d41bb9343d8c Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Tue, 15 Sep 2020 18:33:51 +0000 Subject: [PATCH] check if we actually got repo info --- extensions/got.ksh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/extensions/got.ksh b/extensions/got.ksh index 9d3ba66..ca1292e 100755 --- a/extensions/got.ksh +++ b/extensions/got.ksh @@ -4,8 +4,12 @@ # https://gist.github.com/jrick/d47e1be98609401e86ba0bd6bfbfc8fe function got-push { local r - r=$(got info | awk '$1 ~ "^repository:" {print $2}') - (cd "$r" && git push "$@") + r=$(set -e; got info | awk '$1 ~ "^repository:" {print $2}') + if [ "$r" != "" ]; then + (cd "$r" && git push "$@") + else + return 1 + fi } function got-sync {