-
Notifications
You must be signed in to change notification settings - Fork 280
Closed
Labels
Description
As of 0.65, when I run overcommit with gemfile: false in the config, I get the following error:
Problem loading 'false': my-code-directory/false not found
It seems like when #859 started using regex to parse the gemfile config instead of YAML, we ended up losing some nice YAML.parse functionality?
# .overcommit.yml
gemfile: false
# hook code
config = File.read('.overcommit.yml') =~ /gemfile: ['"]?(.*)['"]?/
gemfile = Regexp.last_match(1) # gemfile is now set to the (truthy) string "false"
if gemfile # this is triggered with gemfile = 'false'
ENV['BUNDLE_GEMFILE'] = gemfile
begin
Bundler.setup
rescue Bundler::BundlerError => e
puts "Problem loading '#{gemfile}': #{e.message}" # Problem loading 'false'
puts "Try running:\nbundle install --gemfile=#{gemfile}" if e.is_a?(Bundler::GemNotFound)
exit 78 # EX_CONFIG
end
end