X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=update;h=fd10a24b725bd744ab58db2f5282a70e05641b2e;hb=a78cda4ceab33318042626138aaf727a2fa871c0;hp=aa62c97ea9762dc153a89ca83b1439f7dac5244a;hpb=d16904d9393b9d9d685a79aceeb1fe3ebb25b468;p=git-scripts.git diff --git a/update b/update index aa62c97..fd10a24 100755 --- a/update +++ b/update @@ -5,20 +5,22 @@ origin="`git config --get --path remote.origin.url`" if [ -n "$origin" ]; then if [ -n "$current" ]; then - echo "UNKNOWN ERROR (both origin and current)" >&2 + echo "Config error (both origin and current)" >&2 exit 1 else - cd "$origin" || exit 1 + cd "$origin" && exec ./update fi elif [ -z "$current" ]; then - echo "UNKNOWN ERROR (neither origin nor current)" >&2 + echo "Wrong directory error (neither origin nor current)" >&2 exit 1 fi git pull --ff-only current master && web="`git config --get --path remote.web.url`" && -[ -n "$web" ] && git push web +if [ -n "$web" ]; then + git push web +fi && cd "$current" && exec git pull origin