Created the dcp-recent script.
[dcp.git] / dcp-runenv
... / ...
CommitLineData
1#!/bin/sh
2
3set -e
4
5usage() {
6 echo "usage: dcp-runenv REPODIR RUNDIR"
7}
8
9if [ $# -lt 2 ]; then
10 usage >&2
11 exit 1
12fi
13
14repodir="$1"
15rundir="$2"
16shift 2
17
18if [ ! -d "$rundir" ]; then mkdir "$rundir"; fi
19
20git clone -q "$repodir" "$rundir/repo"
21for b in "$rundir/repo/.git/refs/remotes/origin"/*; do
22 b="${b##*/}"
23 if [ "$b" = HEAD -o "$b" = master ]; then continue; fi
24 (cd "$rundir/repo"; git branch "$b" "origin/$b") || false
25done
26cp -a "$rundir/repo/control" "$rundir"
27mkdir "$rundir/output"