From d16904d9393b9d9d685a79aceeb1fe3ebb25b468 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Thu, 11 Jun 2015 20:36:39 +0300 Subject: [PATCH] If run from $current execute $origin/update instead --- update | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/update b/update index c253c7f..aa62c97 100755 --- a/update +++ b/update @@ -5,11 +5,12 @@ origin="`git config --get --path remote.origin.url`" if [ -n "$origin" ]; then if [ -n "$current" ]; then - echo "UNKNOWN ERROR (both origin and current)" + echo "UNKNOWN ERROR (both origin and current)" >&2 + exit 1 else - echo "This script must be run in the origin directory: $origin" - fi >&2 - exit 1 + cd "$origin" || exit 1 + exec ./update + fi elif [ -z "$current" ]; then echo "UNKNOWN ERROR (neither origin nor current)" >&2 exit 1 -- 2.39.5