fix bin/rubocop to work when pwd != rails root

Change-Id: Ib8aabe6948800e0ab143b448e4814c916029668b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276296
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
Cody Cutrer 2021-10-19 15:01:50 -06:00
parent dcd871fbce
commit 759268f7dd
1 changed files with 8 additions and 6 deletions

View File

@ -10,13 +10,15 @@
require "bundler/inline"
# be tricksy and use a tiny subset of the gemfile so that
# it will be very quick
gemfile do
source 'https://rubygems.org/'
Dir.chdir(File.expand_path("..", __dir__)) do
# be tricksy and use a tiny subset of the gemfile so that
# it will be very quick
gemfile do
source 'https://rubygems.org/'
gemfile = File.expand_path("../Gemfile.d/rubocop.rb", __dir__)
eval(File.read(gemfile))
gemfile = File.expand_path("../Gemfile.d/rubocop.rb", __dir__)
eval(File.read(gemfile))
end
end
load Gem.bin_path("rubocop", "rubocop")