diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-08-31 14:34:53 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-08-31 14:41:31 +0100 |
commit | c590981f0c198fa0491801a312a65eed054a0778 (patch) | |
tree | 604ea1652c7d5c88ba1c06daf60f0b248ed8ea9f /bin | |
parent | 330ffab561593370f06ea23871749ca3e6bfb3db (diff) |
Stop make_css failing if run on fresh checkout.
The change in 66bd45b6 did not account for being run with no CSS files.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/make_css | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/make_css b/bin/make_css index 6a70aba01..b99459cda 100755 --- a/bin/make_css +++ b/bin/make_css @@ -19,6 +19,7 @@ use MIME::Base64; use MIME::Types; use Path::Tiny; use Pod::Usage; +use Try::Tiny; # Store ARGV in case we need to restart later. my @ARGVorig = @ARGV; @@ -125,7 +126,12 @@ sub compile { sub write_if_different { my ($fn, $data) = @_; $fn = path($fn); - my $current = $fn->slurp_utf8; + my $current = try { + $fn->slurp_utf8; + } catch { + return if $_->{err} eq 'No such file or directory'; + die $_; + }; if (!$current || $current ne $data) { $fn->spew_utf8($data); return 1; |