#!/bin/sh
# * create-bare-repo
#   Allows users to create repo.git
#   ssh git@host create-bare-repo repo1 repo2 ...

set -e

for i in $@; do
# Cleanup names
    repo="`echo "$i" | sed "s/[^a-z0-9\._-]//gi"`"

    if [ -z "$repo" ]; then continue; fi

    mkdir "$repo".git
    pushd "$repo".git
    git init --bare
done