Fix name passing
[girocco/ztw.git] / update.sh
blobe57898de693244b2386171671385f2ca45caf733
1 #!/bin/bash
3 export PATH=/home/pasky/bin:$PATH
5 set -e
7 log="$(mktemp -t repomgr-XXXXXX)"
8 proj="$1"
9 cd "$proj.git"
10 url="$(cat base_url)"
11 mail="$(cat owner)"
13 bang() {
14 if ! "$@" >>"$log" 2>&1; then
16 echo "$* failed with error code $?"
17 echo "Log follows:"
18 cat "$log"
19 } | mail -s "[repo.or.cz] $proj update failed" "$mail",pasky@ucw.cz
20 rm "$log"
21 exit 1
25 GIT_DIR=. bang git mirror "$url"
26 GIT_DIR=. bang git update-server-info
27 date -R >.last_refresh
28 #cat $log
29 rm "$log"