Skip to content

Commit

Permalink
Take advantage of target being a Pathname
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez committed Aug 4, 2021
1 parent a2d6e10 commit c31b8cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bundler/lib/bundler/cli/gem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def run
)
end

if File.exist?(target) && !File.directory?(target)
if target.exist? && !target.directory?
Bundler.ui.error "Couldn't create a new gem named `#{gem_name}` because there's an existing file named `#{gem_name}`."
exit Bundler::BundlerError.all_errors[Bundler::GenericSystemCallError]
end
Expand Down

0 comments on commit c31b8cd

Please sign in to comment.