File: create-new-repo

package info (click to toggle)
bro 2.5-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 78,640 kB
  • sloc: ansic: 126,302; cpp: 95,205; yacc: 2,528; lex: 1,819; sh: 793; python: 700; makefile: 134
file content (45 lines) | stat: -rwxr-xr-x 736 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#! /usr/bin/env bash

cwd=`pwd`

if [ $# != 2 ]; then
    echo "usage: $0 <name> <dst-repo-dir>"
    exit 1
fi

name=`pwd`/$1
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 tests Baseline; do
    mkdir $dir
    touch $dir/.gitignore
done

ln -s ../subdir-btest.cfg ./btest.cfg

cp $cwd/`dirname $0`/skel/test.skeleton tests
cp $cwd/`dirname $0`/skel/traces.cfg .
cp $cwd/`dirname $0`/skel/Makefile .
cp $cwd/`dirname $0`/skel/.gitignore .

git add * .gitignore

git commit -m "Repository initialized."
git push origin master