various scripts I use to make my life easier
1#!/bin/bash
2# this script allows the creation of new repos over ssh on git server
3# public repos will get a knot.conf containing the remote
4# private repos will just exist on the server
5# USAGE:
6# ssh git@<host> new-repo
7# - follow the prompts
8
9echo "oh look you are starting a project you won't finish again."
10echo "What is your projects name?"
11read PROJECT_NAME
12if [[ $PROJECT_NAME!=*.git ]]; then
13 PROJECT_NAME="${PROJECT_NAME}.git"
14fi
15echo "What's the mirror repo remote url?(leave blank if private)"
16read REMOTE_URL
17
18git --bare init "${PROJECT_NAME}"
19
20if [[ $REMOTE_URL ]]; then
21 touch "${PROJECT_NAME}/knot.conf"
22 echo "${REMOTE_URL}" >> "${PROJECT_NAME}/knot.conf"
23fi
24
25echo "git url: ${USER}@${HOSTNAME}:${PROJECT_NAME}"
26if [[ $REMOTE_URL ]]; then
27 echo "public repo: ${REMOTE_URL}"
28fi
29#vim: filetype=bash