aboutsummaryrefslogtreecommitdiff
path: root/cgit/ssh/git-shell-commands/new
blob: 4bd550aa44ca9e714d1aa47db5e3399158c05568 (plain) (blame)
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
#!/usr/bin/env sh

set -eu

. "$(dirname $0)/_utils/input.sh"

remote_host="git.ediblemonad.dev"
owner_info="Akshay Nair <phenax5@gmail.com>"

repo_name="$(input_repo_name)";
repo_dir="/git/${repo_name}.git"

if [ -d "$repo_dir" ]; then
  echo "Error: $repo_name already exists" 1>&2
  exit 1;
fi

description="$(input_repo_description "$repo_dir")"

git --bare init "$repo_dir"

cd "$repo_dir"
echo "$description" > description
echo "$owner_info" > owner_info

echo "git@${remote_host}:${repo_dir}"