Skip to content

Commit

Permalink
Fix gems.rb check
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyCTHsu committed Feb 24, 2023
1 parent 322deda commit e6baa62
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib-injection/auto_inject.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,20 @@
gemfile = Bundler::SharedHelpers.default_gemfile
lockfile = Bundler::SharedHelpers.default_lockfile

if gemfile.basename == 'gems.rb'
puts gemfile
puts lockfile

if gemfile.basename.to_s == 'gems.rb'
datadog_gemfile = gemfile.dirname + "datadog-Gemfile"
datadog_lockfile = lockfile.dirname + "datadog-Gemfile.lock"
else
datadog_gemfile = gemfile.dirname + ("datadog-#{gemfile.basename}")
datadog_lockfile = lockfile.dirname + ("datadog-#{lockfile.basename}")
end

puts datadog_gemfile
puts datadog_lockfile

# Copies for trial
FileUtils.cp gemfile, datadog_gemfile
FileUtils.cp lockfile, datadog_lockfile
Expand Down

0 comments on commit e6baa62

Please sign in to comment.