summaryrefslogtreecommitdiff
path: root/init
blob: da5243bfc8e93b5dfde516cc10c4b53fc260fe6d (plain)
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
#!/bin/sh

if [ $# -ne 1 ]; then
    echo "usage: init <name>"
    exit 1
fi

base_dir="$HOME"
new_repo="$1"

case $new_repo in
    *\.git)
	;;
    *)
	new_repo="${new_repo}.git"
	;;
esac

if [ -d "$new_repo" ]; then
    echo "$new_repo already exists"
    exit 1
fi

mkdir "$base_dir/$new_repo"
git init --bare "$base_dir/$new_repo"