From 555282985de8e5610d54afcadde66f48fa3aa31f Mon Sep 17 00:00:00 2001 From: John Evans Date: Thu, 3 Mar 2016 01:12:19 -0500 Subject: [PATCH] Add -m flag to git-setup to set the initial commit message. --- bin/git-setup | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/git-setup b/bin/git-setup index 6fdf675..d1319ec 100755 --- a/bin/git-setup +++ b/bin/git-setup @@ -1,5 +1,12 @@ #!/usr/bin/env bash +COMMIT_MESSAGE='Initial commit' + +if [ "$1" == "-m" ]; then + COMMIT_MESSAGE=$2 + shift; shift +fi + gitdirexists(){ if [ -d ".git" ]; then echo ".git directory already exists, aborting" @@ -13,4 +20,4 @@ mkdir -p "$dir" \ && gitdirexists \ && git init \ && git add . \ - && git commit --allow-empty -m 'Initial commit' + && git commit --allow-empty -m "$COMMIT_MESSAGE"