From 07fca766c65fba9c839f3ba3a4fdec9a99ef59d0 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 7 Jun 2011 22:54:24 -0300 Subject: Updating puppet working copy just if it and it's origin exists --- files/update-puppet-conf.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/files/update-puppet-conf.sh b/files/update-puppet-conf.sh index dddae94..b299950 100644 --- a/files/update-puppet-conf.sh +++ b/files/update-puppet-conf.sh @@ -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 -- cgit v1.2.3