Skip to content

Commit

Permalink
Change directory to the path specified by -C option.
Browse files Browse the repository at this point in the history
The directory specified by `-C` option must be reflected, while the
already loaded spec file must be used, wherever it came from.

Fixes #3953
  • Loading branch information
voxik committed Sep 17, 2020
1 parent 8fd5dee commit 15e431b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/rubygems/commands/build_command.rb
Expand Up @@ -85,8 +85,7 @@ def build_gem(gem_name)
spec = Gem::Specification.load(gemspec)

if options[:build_path]
Dir.chdir(File.dirname(gemspec)) do
spec = Gem::Specification.load(File.basename(gemspec))
Dir.chdir(options[:build_path]) do
build_package(spec)
end
else
Expand Down

0 comments on commit 15e431b

Please sign in to comment.