Man page copying: only copy .1

- check if possible first
This commit is contained in:
Olle Jonsson 2016-02-25 19:14:44 +01:00
parent ee86b35068
commit 772e403e40

View File

@ -12,12 +12,14 @@ RSpec::Core::RakeTask.new(:rspec)
task :create_man do |_t| task :create_man do |_t|
os_prefix = "/usr/local" os_prefix = "/usr/local"
man_prefix = Pathname("#{os_prefix}/share/man/man1") man_prefix = Pathname("#{os_prefix}/share/man/man1")
man_pages = "man/git-*" man_pages = "man/git-*.1"
Pathname.glob(man_pages) do |path| Pathname.glob(man_pages) do |path|
if path.exist? && man_prefix.exist?
FileUtils.cp(path, man_prefix + path.basename) FileUtils.cp(path, man_prefix + path.basename)
end end
end end
end
task checks: [:rubocop, :rspec] task checks: [:rubocop, :rspec]
task default: [:create_man] task default: [:create_man]