Merge pull request #1199 from MikeMcQuaid/man-fail-if-changed-date
man: set date when --fail-if-changed.
This commit is contained in:
commit
c64ce3ef07
@ -78,10 +78,25 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
def convert_man_page(markup, target)
|
def convert_man_page(markup, target)
|
||||||
|
manual = target.basename(".1")
|
||||||
|
organisation = "Homebrew"
|
||||||
|
|
||||||
|
# Set the manpage date to the existing one if we're checking for changes.
|
||||||
|
# This avoids the only change being e.g. a new date.
|
||||||
|
date = if ARGV.include?("--fail-if-changed") &&
|
||||||
|
target.extname == ".1" && target.exist?
|
||||||
|
/"(\d{1,2})" "([A-Z][a-z]+) (\d{4})" "#{organisation}" "#{manual}"/ =~ target.read
|
||||||
|
Date.parse("#{$1} #{$2} #{$3}")
|
||||||
|
else
|
||||||
|
Date.today
|
||||||
|
end
|
||||||
|
date = date.strftime("%Y-%m-%d")
|
||||||
|
|
||||||
shared_args = %W[
|
shared_args = %W[
|
||||||
--pipe
|
--pipe
|
||||||
--organization=Homebrew
|
--organization=#{organisation}
|
||||||
--manual=#{target.basename(".1")}
|
--manual=#{target.basename(".1")}
|
||||||
|
--date=#{date}
|
||||||
]
|
]
|
||||||
|
|
||||||
format_flag, format_desc = target_path_to_format(target)
|
format_flag, format_desc = target_path_to_format(target)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user