diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2017-07-22 03:07:22 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-07-22 03:07:22 -0600 |
| commit | fb51f83f2d85f5d64271ead3d1fb8b69c56014fe (patch) | |
| tree | 8e08166b70246838247d77ffd7d424d77c391e9e | |
| parent | 65e65f2b645cbd9ecf18bc70d6dab94eb330d4e0 (diff) | |
resolves #2323 don't warn if src stylesheet can't be read and dest already exists (PR #2329)
- change warning to preserve legacy scenario
| -rw-r--r-- | lib/asciidoctor.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/asciidoctor.rb b/lib/asciidoctor.rb index 0ea5f1b3..775b5a15 100644 --- a/lib/asciidoctor.rb +++ b/lib/asciidoctor.rb @@ -1536,9 +1536,11 @@ module Asciidoctor # NOTE in this case, copycss is a source location (but cannot be a URI) stylesheet_src = doc.normalize_system_path stylesheet_src end - stylesheet_dst = doc.normalize_system_path stylesheet, stylesoutdir, (doc.safe >= SafeMode::SAFE ? outdir : nil) - if stylesheet_src != stylesheet_dst && (stylesheet_content = doc.read_asset stylesheet_src, :warn_on_failure => true, :label => 'stylesheet') - ::IO.write stylesheet_dst, stylesheet_content + stylesheet_dest = doc.normalize_system_path stylesheet, stylesoutdir, (doc.safe >= SafeMode::SAFE ? outdir : nil) + # NOTE don't warn if src can't be read and dest already exists (see #2323) + if stylesheet_src != stylesheet_dest && (stylesheet_data = doc.read_asset stylesheet_src, + :warn_on_failure => !(::File.file? stylesheet_dest), :label => 'stylesheet') + ::IO.write stylesheet_dest, stylesheet_data end end |
