Skip to content

Commit 2e8fea6

Browse files
committed
Improve extconf
1 parent c75f094 commit 2e8fea6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ext/rdoc/extconf.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
# Generate all parse files using racc and kpeg. This is not necessary for regular gem installation, but it is when
44
# installing RDoc from the git source. Without this, the generated parse files would not exist and RDoc would not work
5-
system("rake generate") if File.exist?("../../.git")
5+
Dir.chdir(File.expand_path("../..", __dir__)) do
6+
if !File.exist?("lib/rdoc/markdown.rb") && Dir.exist?(".git")
7+
system("rake generate", exception: true)
8+
end
9+
end
610

711
# RDoc doesn't actually have a native extension, but a Makefile needs to exist in order to successfully install the gem
812
require "mkmf"

0 commit comments

Comments
 (0)