]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/nominatim/templates/default/updater.erb
nominatim: run git update in source directory
[chef.git] / cookbooks / nominatim / templates / default / updater.erb
index b259c4ed687dd86e56595493c2a60824273f1d91..8a3cf027edf4f2549a835e300d8e5d566afc8c49 100644 (file)
@@ -3,8 +3,7 @@
 # DO NOT EDIT - This file is being maintained by Chef
 
 # Change to Nominatim directory
-DIR="$( cd "$( dirname "$0" )" && pwd )"
-cd $DIR/..
+cd <%= @bindir %>
 
 while [ ! -f "<%= @update_stop_file %>" ]
 do
@@ -14,12 +13,14 @@ do
 
     ./utils/update.php --no-npi --import-osmosis
 
+    pushd <%= @srcdir %>
     if git fetch origin; then
       # will trigger recompilation if necessary
       git merge origin/<%= @branch %>
     else
       echo "WARNING: git fetch failed."
     fi
+    popd
 
     # sleep a bit if updates take less than a minute
     endtime=`date +%s`