mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-02-01 22:11:30 +01:00
31 lines
1.2 KiB
Diff
31 lines
1.2 KiB
Diff
From: Jakub Jirutka <jakub@jirutka.cz>
|
|
Date: Fri, 26 Mar 2021 23:17:29 +0100
|
|
Subject: [PATCH] Fix --help when man pages are moved out
|
|
|
|
Allow to move man pages from the gem's directory to the standard system
|
|
location (/usr/share/man) without breaking `bundler --help`.
|
|
|
|
--- a/lib/bundler/cli.rb
|
|
+++ b/lib/bundler/cli.rb
|
|
@@ -123,8 +123,9 @@
|
|
end
|
|
|
|
man_path = File.expand_path("man", __dir__)
|
|
- man_pages = Hash[Dir.glob(File.join(man_path, "**", "*")).grep(/.*\.\d*\Z/).collect do |f|
|
|
- [File.basename(f, ".*"), f]
|
|
+ man_pages = Hash[Dir.glob(File.join(man_path, "**", "*")).grep(/.*\.\d*\.ronn\Z/).collect do |f|
|
|
+ man_name = File.basename(f, ".ronn")
|
|
+ [File.basename(man_name, ".*"), man_name]
|
|
end]
|
|
|
|
if man_pages.include?(command)
|
|
@@ -132,7 +133,7 @@
|
|
if Bundler.which("man") && man_path !~ %r{^file:/.+!/META-INF/jruby.home/.+}
|
|
Kernel.exec "man #{man_page}"
|
|
else
|
|
- puts File.read("#{man_path}/#{File.basename(man_page)}.ronn")
|
|
+ puts File.read("#{man_path}/#{man_page}.ronn")
|
|
end
|
|
elsif command_path = Bundler.which("bundler-#{cli}")
|
|
Kernel.exec(command_path, "--help")
|