]> gitweb.fluxo.info Git - templater.git/commitdiff
Puppet: better puppet integration
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 27 Oct 2017 13:04:23 +0000 (11:04 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 27 Oct 2017 13:04:23 +0000 (11:04 -0200)
templater

index 1c5d7d6767cf548b2da86ffed5e83186b1591822..8061ec867f78460f6a7a24ffab81d0a70fc1ce97 100755 (executable)
--- a/templater
+++ b/templater
@@ -165,10 +165,16 @@ function templater_puppet {
     __templater___templater_echo "Setting up puppet..."
 
     # Use the best approach
-    #git clone $BOOSTRAP $PROJECT/puppet
-    #git submodule add $BOOSTRAP puppet
-    git remote add puppet $BOOTSTRAP
-    git subtree add --prefix puppet $BOOTSTRAP master --squash
+    if [ -d '.git' ]; then
+      #git clone $BOOSTRAP $PROJECT/puppet
+      #git submodule add $BOOSTRAP puppet
+      git remote add puppet $BOOTSTRAP
+      git add .
+      git commit -m "Commiting changes before running git-subtree"
+      git subtree add --prefix puppet $BOOTSTRAP master --squash
+    else
+      git clone $BOOSTRAP puppet
+    fi
   else
     __templater_echo "Puppet already set"
   fi