Skip to content

Instantly share code, notes, and snippets.

@bkcsoft
Created January 2, 2018 00:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bkcsoft/7f4a46d1b2e9933672475b0ad59dbaf9 to your computer and use it in GitHub Desktop.
Save bkcsoft/7f4a46d1b2e9933672475b0ad59dbaf9 to your computer and use it in GitHub Desktop.
Template Patcher for try.gitea.io
#!/usr/bin/env bash
function die() {
echo -n $@ 1>&2
exit 1
}
cd $(docker volume inspect -f '{{ .Mountpoint }}' demo_gitea)/templates/base/
wget -o head.tmpl.master https://raw.githubusercontent.com/go-gitea/gitea/master/templates/base/head.tmpl || die "fetch failed"
# patch .master => .new, crash if failure
patch -uR -o head.tmpl.new head.tmpl.master head.tmpl.patch || die "patch failed"
# insert new template, remove partials
mv head.tmpl.new head.tmpl
rm head.tmpl.master
systemctl restart demo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment