Skip to content

Commit eeee528

Browse files
committedApr 26, 2019
fix: gracefully handle read only file system (eg RunKit)
1 parent f701a22 commit eeee528

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed
 

‎lib/pact/configuration.rb

+5
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@ def create_logger
169169
logger = ::Logger.new(log_path)
170170
logger.level = ::Logger::DEBUG
171171
logger
172+
rescue Errno::EROFS
173+
# So we can run on RunKit
174+
logger = ::Logger.new($stdout)
175+
logger.level = ::Logger::DEBUG
176+
logger
172177
end
173178
end
174179

‎lib/pact/consumer_contract/pact_file.rb

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ def read uri, options = {}
3333
def save_pactfile_to_tmp pact, name
3434
::FileUtils.mkdir_p Pact.configuration.tmp_dir
3535
::File.open(Pact.configuration.tmp_dir + "/#{name}", "w") { |file| file << pact}
36+
rescue Errno::EROFS => e
37+
# do nothing, probably on RunKit
3638
end
3739

3840
def render_pact(uri_string, options)

0 commit comments

Comments
 (0)
Please sign in to comment.