zeek/testing/external/scripts/create-new-repo
2011-06-30 22:54:25 -07:00

43 lines
660 B
Bash
Executable file

#! /usr/bin/env bash
cwd=`pwd`
if [ $# != 2 ]; then
echo "usage: $0 <name> <dst-repo-dir>"
exit 1
fi
name=`pwd`/$1.git
repo=$2
if [ -e $repo ]; then
echo "$repo already exists, aborting."
exit 1
fi
if [ -e $name ]; then
echo "$name already exists, aborting."
exit 1
fi
mkdir $repo
( cd $repo && git init --bare )
git clone $repo $name
cd $name
for dir in Traces Tests Baseline; do
mkdir $dir
touch $dir/.gitignore
done
ln -s ../subdir-btest.cfg ./btest.cfg
cp $cwd/`dirname $0`/files/test.skeleton tests
cp $cwd/`dirname $0`/files/Makefile .
git add *
git commit -m "Repository initialized."
git push origin master