]> git.phdru.name Git - phdru.name/cgi-bin/blog-ru/search-tags.git/blob - update
Refactor update script
[phdru.name/cgi-bin/blog-ru/search-tags.git] / update
1 #! /bin/sh
2
3 "$HOME"/admin/prog/git-scripts/update || exit 1
4
5 current="`git config --get --path remote.current.url`"
6
7 # Copy templates and generated files with timestamps to avoid rebuilding
8 rsync -ahP "$current"/html/html.py "$current"/html/html.tmpl \
9            "$current"/html/redirect.py "$current"/html/redirect.tmpl html &&
10
11 # Copy files generated by yacc
12 rsync -ahP "$current"/parser.out "$current"/parsetab.py . &&
13
14 cgi="`git config --get --path remote.cgi.url`" &&
15 if [ -n "$cgi" ]; then
16    umask 022 && cd "$cgi" && git pull origin &&
17    rsync -ahP "$current"/html/html.py "$current"/html/html.tmpl \
18               "$current"/html/redirect.py "$current"/html/redirect.tmpl html &&
19    rsync -ahP "$current"/parser.out "$current"/parsetab.py . &&
20    compyleall && chmod -R a+rX .
21 fi &&
22
23 cd "$current" && exec git pull origin