X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/8323b6a7e371e288c06626e5e7bf80e440fe9d19..8ccf941a82940d016e9c68bdf0c29e190953c7f7:/cookbooks/web/templates/default/cleanup-assets.erb diff --git a/cookbooks/web/templates/default/cleanup-assets.erb b/cookbooks/web/templates/default/cleanup-assets.erb index 132c8260a..175ce8b97 100644 --- a/cookbooks/web/templates/default/cleanup-assets.erb +++ b/cookbooks/web/templates/default/cleanup-assets.erb @@ -3,6 +3,7 @@ use strict; use warnings; +use Errno; use IO::Dir; use IO::File; use JSON::XS; @@ -13,17 +14,17 @@ my $manifest; if (my $file = IO::File->new("${root}/tmp/manifest.json", "r")) { - $manifest = decode_json(join("\n", $file->getlines)); + my $manifest = decode_json(join("\n", $file->getlines)); $file->close; + + expire_assets($manifest, "${root}/public/assets", ""); } else { - die "Can't open ${root}/tmp/manifest.json: $!"; + die "Can't open ${root}/tmp/manifest.json: $!" unless $!{ENOENT}; } -expire_assets($manifest, "${root}/public/assets", ""); - exit 0; sub expire_assets