#!/bin/sh BASE_REPO_DIR="public_repos/" GIT_USER="BiRabittoh" GIT_EMAIL="birabittoh@duck.com" # Ask the user for repo details read -p 'Nome repo: ' repo_name read -p 'Descrizione: ' repo_desc # TODO: check input if [ -z "$repo_name" ]; then exit 1 fi if [ -z "$repo_desc" ]; then exit 1 fi repo_path="$HOME/$BASE_REPO_DIR/$repo_name" if [ -d "$repo_path" ]; then echo "$repo_name already exists." exit 1 fi echo "Looks good: $repo_path" # Actually create repo mkdir $repo_path git init --bare $repo_path git -C $repo_path config --local gitweb.owner "$GIT_USER <$GIT_EMAIL>" echo "$repo_desc" > $repo_path/description echo echo "git remote add birabittoh user@birabittoh.duckdns.org:public_repos/$repo_name" echo "git push -u birabittoh master" echo