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 cf30b41..8015919 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