Skip to content

Commit 52f3e64

Browse files
Produce empty makefile if lib/cucumber/messages_pb.rb exists
This should avoid trouble when installing, for example if bash is not available. The makefile should only be used during development, for released version the file is there and nothing should be done.
1 parent b923293 commit 52f3e64

File tree

1 file changed

+21
-2
lines changed
  • cucumber-messages/ruby/ext/cucumber-messages

1 file changed

+21
-2
lines changed

cucumber-messages/ruby/ext/cucumber-messages/extconf.rb

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
11
require "mkmf"
22

33
find_executable('protoc')
4+
makefile_content = ''
45

5-
File.open(File.join(Dir.pwd, 'Makefile'), 'w') do |file|
6-
file.write %Q(
6+
if File.exist?('../../lib/cucumber/messages_pb.rb')
7+
makefile_content = %Q(
8+
default:
9+
\t@echo "Nothing to do"
10+
.PHONY: clean
11+
12+
install:
13+
\t@echo "Nothing to do"
14+
.PHONY: clean
15+
16+
clean:
17+
\t@echo "Nothing to do"
18+
.PHONY: clean
19+
)
20+
else
21+
makefile_content = %Q(
722
SHELL := /usr/bin/env bash
823
924
default: ../../lib/cucumber/messages_pb.rb
@@ -21,4 +36,8 @@
2136
)
2237
end
2338

39+
File.open(File.join(Dir.pwd, 'Makefile'), 'w') do |file|
40+
file.write makefile_content
41+
end
42+
2443
$makefile_created = true

0 commit comments

Comments
 (0)