Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Ensure git is executed inside the gemspec dir
Browse files Browse the repository at this point in the history
When a Gemfile was pointing to a local gem using git to list its files the git command
was executed from within the wrong dir. This fixes the issue without:

1. introducing new dependencies (e.g. `shellwords`)
2. any risks with non-trivial paths (e.g. paths containing spaces)
  • Loading branch information
elia authored Nov 27, 2017
1 parent 914a4a8 commit e0af339
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bundler/templates/newgem/newgem.gemspec.tt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
"public gem pushes."
end

spec.files = `git ls-files -z`.split("\x0").reject do |f|
spec.files = Dir.chdir(__dir__){`git ls-files -z`}.split("\x0").reject do |f|
f.match(%r{^(test|spec|features)/})
end
spec.bindir = "exe"
Expand Down

0 comments on commit e0af339

Please sign in to comment.