diff --git a/etc/push-hugo-branch b/etc/push-hugo-branch new file mode 100755 index 0000000..4616e3c --- /dev/null +++ b/etc/push-hugo-branch @@ -0,0 +1,20 @@ +#!/bin/bash + +# requires: push access to the hugo repo in your go path (i.e. your fork must be origin) + +tag=$(git tag | tail -1) + +cd ../../gohugoio/hugo +hugo_tag=$(grep github.com/niklasfasching/go-org go.sum | head -1 | awk '{print $2}') + +if [[ "$tag" == "$hugo_tag" ]]; then + echo "tag $tag already exists in hugo" + exit 1 +fi + +git checkout -b "update-go-org-to-$tag" origin/master || git reset --hard origin/master +git pull +go get "github.com/niklasfasching/go-org@$tag" || exit 1 +sed -i "\_github.com/niklasfasching/go-org ${hugo_tag}_d" go.sum +git commit -a -m "deps: Update go-org to $tag" +git push --force-with-lease