diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2017-10-27 11:08:24 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2017-10-27 11:08:24 -0200 |
commit | c1e0bcfe4ce68e78e9eaa22ba731c82190ff1775 (patch) | |
tree | 40fb1de54ccae6cec284209a60dad697b45ad4b9 /templater | |
parent | 18f53deca07e3882f5995f18b1bf646651dd1c63 (diff) | |
download | templater-c1e0bcfe4ce68e78e9eaa22ba731c82190ff1775.tar.gz templater-c1e0bcfe4ce68e78e9eaa22ba731c82190ff1775.tar.bz2 |
Puppet: check for a clean git repo
Diffstat (limited to 'templater')
-rwxr-xr-x | templater | 24 |
1 files changed, 14 insertions, 10 deletions
@@ -164,17 +164,21 @@ function templater_puppet { if [ ! -d "puppet" ]; then __templater___templater_echo "Setting up puppet..." - # Use the best approach - 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 + if [ ! -d '.git' ]; then + __templater_echo "Error: puppet needs a working git setup, skipping" + return + fi + + if [ "`git status -s | wc -l`" != 0 ]; then + __templater_echo "Please commit changes before running setting up puppet" + return fi + + # Use the best approach + #git clone $BOOSTRAP puppet + #git submodule add $BOOSTRAP puppet + git remote add puppet $BOOTSTRAP + git subtree add --prefix puppet $BOOTSTRAP master --squash else __templater_echo "Puppet already set" fi |