Skip to content

Commit 15e431b

Browse files
committed
Change directory to the path specified by -C option.
The directory specified by `-C` option must be reflected, while the already loaded spec file must be used, wherever it came from. Fixes #3953
1 parent 8fd5dee commit 15e431b

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

lib/rubygems/commands/build_command.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ def build_gem(gem_name)
8585
spec = Gem::Specification.load(gemspec)
8686

8787
if options[:build_path]
88-
Dir.chdir(File.dirname(gemspec)) do
89-
spec = Gem::Specification.load(File.basename(gemspec))
88+
Dir.chdir(options[:build_path]) do
9089
build_package(spec)
9190
end
9291
else

0 commit comments

Comments
 (0)