Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [ $# -eq 1 ]; then
- TARGET_DIR=$(echo $1 | sed 's/$/.git/')
- echo -n "Verifying \"$TARGET_DIR\" ... "
- if [ -d $TARGET_DIR ]; then
- echo "failed! Repository already exists!"
- exit 1
- else
- echo "success!"
- echo "Creating folder ... " && mkdir $TARGET_DIR
- echo "Creating repository ... " && git init --bare $TARGET_DIR
- echo "Chaging ownership ... " && chown -R git:git $TARGET_DIR
- fi
- elif [ $# -gt 1 ]; then
- echo "TODO"
- exit 2
- else
- echo "Need a repo name idiot!"
- exit 1
- fi
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement