]> gitweb.fluxo.info Git - puppet-puppet.git/commitdiff
Updating puppet working copy just if it and it's origin exists
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 8 Jun 2011 01:54:24 +0000 (22:54 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 8 Jun 2011 01:54:24 +0000 (22:54 -0300)
files/update-puppet-conf.sh

index dddae9406ad0fb2ecb4ab79fef2b60168166eee1..b299950e0bcb3ffa84d542eae2452eb51936ec92 100644 (file)
@@ -10,8 +10,10 @@ ORIGIN_DIR=/var/git/repositories/puppet.git
 
 unset GIT_DIR
 
-cd ${PUPPET_DIR}
-git pull ${ORIGIN_DIR} master
-git checkout -f
-git submodule update --init
-git clean -d -f
+if [ -d "${PUPPET_DIR}/.git" ] && [ -d "${ORIGIN_DIR}" ]; then
+  cd ${PUPPET_DIR}
+  git pull ${ORIGIN_DIR} master
+  git checkout -f
+  git submodule update --init
+  git clean -d -f
+fi