aboutsummaryrefslogtreecommitdiff
path: root/share/templater/git
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-10-31 17:23:15 -0200
committerSilvio Rhatto <rhatto@riseup.net>2017-10-31 17:23:15 -0200
commit82e6bce4ea8fc61e99f6eb32dc12c470b93dccd4 (patch)
tree4b81210f80e8a3e85a1d65b01beb67f92a727066 /share/templater/git
parent8e83eb20f8841022cf9a221f2e8447cdba1f7270 (diff)
downloadtemplater-82e6bce4ea8fc61e99f6eb32dc12c470b93dccd4.tar.gz
templater-82e6bce4ea8fc61e99f6eb32dc12c470b93dccd4.tar.bz2
New module format
Diffstat (limited to 'share/templater/git')
-rw-r--r--share/templater/git/description1
-rwxr-xr-xshare/templater/git/setup32
2 files changed, 33 insertions, 0 deletions
diff --git a/share/templater/git/description b/share/templater/git/description
new file mode 100644
index 0000000..d57d21a
--- /dev/null
+++ b/share/templater/git/description
@@ -0,0 +1 @@
+Git repository
diff --git a/share/templater/git/setup b/share/templater/git/setup
new file mode 100755
index 0000000..de2b750
--- /dev/null
+++ b/share/templater/git/setup
@@ -0,0 +1,32 @@
+#!/bin/bash
+#
+# Git templater module.
+#
+
+# Parameters
+SHARE="$1"
+
+# Include basic functions
+source $SHARE/templater/functions || exit 1
+
+# Git implementation
+function templater_git {
+ if [ ! -d ".git" ]; then
+ __templater_echo "Setting up git..."
+ touch .gitignore
+
+ __templater_user_input GIT_USER User "-> Choose a git user name"
+ __templater_user_input GIT_EMAIL user@example.org "-> Choose a git email address"
+
+ git init
+ git config user.name "$GIT_USER"
+ git config user.email "$GIT_EMAIL"
+ git add .
+ git commit -m "Initial import"
+ else
+ __templater_echo "Git already set"
+ fi
+}
+
+# Dispatch
+templater_git