Only copy taginfo-history.db if it exists
[chef.git] / 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