aboutsummaryrefslogtreecommitdiff
path: root/templater
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-10-27 10:57:59 -0200
committerSilvio Rhatto <rhatto@riseup.net>2017-10-27 10:57:59 -0200
commitad077eac38a0616cebe88105a9e44b3b54e0d263 (patch)
tree77456cbfedaeb022c341b01bb3d179973d4f06dd /templater
parent619cdf4206536ee1b67e0ddefe3ba4fc8a1cb9ec (diff)
downloadtemplater-ad077eac38a0616cebe88105a9e44b3b54e0d263.tar.gz
templater-ad077eac38a0616cebe88105a9e44b3b54e0d263.tar.bz2
Better message handling
Diffstat (limited to 'templater')
-rwxr-xr-xtemplater36
1 files changed, 20 insertions, 16 deletions
diff --git a/templater b/templater
index 2fb612b..f7d5b48 100755
--- a/templater
+++ b/templater
@@ -41,6 +41,12 @@ function __templater_implementations {
grep "^function templater_" $PROGRAM | cut -d ' ' -f 2 | sed -e 's/templater_//'
}
+# Message
+function __templater_echo {
+ #echo ""
+ echo "-> $*"
+}
+
# Checkout to develop branch if available
function __templater_checkout_develop {
if git branch --list develop | grep -q develop; then
@@ -84,11 +90,14 @@ function templater_basic {
# Git implementation
function templater_git {
if [ ! -d ".git" ]; then
+ __templater___templater_echo "Setting up git..."
touch .gitignore
git init
git add .
#git commit -m "Initial import"
+ else
+ __templater_echo "Git already installed"
fi
}
@@ -97,8 +106,7 @@ function templater_githooks {
# TODO: check if githooks are already set
if [ -d ".git" ]; then
if which git-hooks &> /dev/null; then
- echo ""
- echo "Installing hooks..."
+ __templater___templater_echo "Setting up git-hooks..."
git hooks --install
fi
fi
@@ -108,11 +116,13 @@ function templater_githooks {
function templater_gitflow {
if ! grep -q '^\[gitflow' .git/config; then
if ! git branch --list develop | grep -q develop; then
+ __templater___templater_echo "Setting up git-flow..."
+
git branch develop
if [ -e "/usr/lib/git-core/git-flow" ]; then
echo ""
- echo "Setting up git-flow..."
+ __templater_echo "Setting up git-flow..."
git flow init -d
fi
fi
@@ -122,8 +132,7 @@ function templater_gitflow {
# Vagrant implementation
function templater_vagrant {
if [ ! -e "Vagrantfile" ]; then
- echo ""
- echo "Setting up vagrant..."
+ __templater___templater_echo "Setting up vagrant..."
#__templater_checkout_develop
vagrant init
echo '.vagrant' >> .gitignore
@@ -134,8 +143,7 @@ function templater_vagrant {
# KVMX implementation
function templater_kvmx {
if [ ! -e "kvmxfile" ]; then
- echo ""
- echo "Setting up vagrant..."
+ __templater___templater_echo "Setting up kvmx..."
kvmx init
#git commit -a -m "Adds kvmx support"
fi
@@ -144,8 +152,7 @@ function templater_kvmx {
# Puppet implementation
function templater_puppet {
if [ ! -d "puppet" ]; then
- echo ""
- echo "Setting up puppet..."
+ __templater___templater_echo "Setting up puppet..."
# Use the best approach
#git clone $BOOSTRAP $PROJECT/puppet
@@ -158,8 +165,7 @@ function templater_puppet {
# Ikiwiki implementation
function templater_ikiwiki {
if [ ! -e "ikiwiki.yaml" ]; then
- echo ""
- echo "Setting up ikiwiki..."
+ __templater___templater_echo "Setting up ikiwiki..."
#__templater_checkout_develop
__templater_copy_or_append ikiwiki .gitignore
@@ -199,8 +205,7 @@ function templater_ikiwiki {
# Sphinx implementation
function templater_sphinx {
if [ ! -e "conf.py" ]; then
- echo ""
- echo "Setting up sphinx..."
+ __templater_echo "Setting up sphinx..."
#__templater_checkout_develop
__templater_copy_or_append sphinx .gitignore
@@ -229,8 +234,7 @@ function templater_sphinx {
# Pelican implementation
function templater_pelican {
if [ ! -e "pelicanconf.py" ]; then
- echo ""
- echo "Setting up pelican..."
+ __templater_echo "Setting up pelican..."
#__templater_checkout_develop
__templater_copy_or_append pelican .gitignore
@@ -312,4 +316,4 @@ fi
# Teardown
cd $CWD
-echo "Done processing the project :)"
+__templater_echo "Done processing the project :)"