summaryrefslogtreecommitdiff
path: root/tool/lib
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-11-13 18:05:11 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-11-13 18:05:11 +0900
commit70c9d5b504525afd679cb45174e9544f150428a5 (patch)
tree87589366bbfc3cb29d66dad143bf5acdaf1d4b2f /tool/lib
parent66529eef883cc8bb9bc628122f9fa0104acd79fc (diff)
downloadruby-70c9d5b504525afd679cb45174e9544f150428a5.tar.gz
Try to overwrite the file in VPATH if possible
Diffstat (limited to 'tool/lib')
-rw-r--r--tool/lib/output.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/tool/lib/output.rb b/tool/lib/output.rb
index cbaa4b5a3e..3a9f3d87ae 100644
--- a/tool/lib/output.rb
+++ b/tool/lib/output.rb
@@ -28,7 +28,8 @@ class Output
updated = color.fail("updated")
outpath = nil
- if @ifchange and (@vpath.open(@path, "rb") {|f| outpath = f.path; f.read == data} rescue false)
+ if (@ifchange or overwrite) and
+ (@vpath.open(@path, "rb") {|f| outpath = f.path; f.read == data if @ifchange} rescue false)
puts "#{outpath} #{unchanged}"
written = false
else