]> git.openstreetmap.org Git - chef.git/commitdiff
Only copy taginfo-history.db if it exists
authorTom Hughes <tom@compton.nu>
Sun, 16 Feb 2014 13:56:45 +0000 (13:56 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 16 Feb 2014 13:56:45 +0000 (13:56 +0000)
cookbooks/taginfo/templates/default/update-taginfo.erb

index cf30b4178fbace55d5a6d7143c01ade7d1d31e44..801591927356f49ebe9fa4e2154c1c151953fa6f 100644 (file)
@@ -6,8 +6,13 @@ set -e
 
 ROOT="<%= @directory %>"
 
-cp $ROOT/data/taginfo-history.db $ROOT/sources
+if [ -f "$ROOT/data/taginfo-history.db" ]
+then
+    cp $ROOT/data/taginfo-history.db $ROOT/sources
+fi
+
 $ROOT/taginfo/sources/update_all.sh $ROOT/sources
+
 mv $ROOT/data/taginfo-* $ROOT/data/old
 mv $ROOT/sources/taginfo-*.db $ROOT/sources/*/taginfo-*.db $ROOT/data
 mv $ROOT/sources/download/* $ROOT/download