Skip to content

Commit

Permalink
Make printed drive letters consistent on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez committed Oct 26, 2020
1 parent ad9f9d1 commit ae4ac4d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
2 changes: 2 additions & 0 deletions bundler/lib/bundler/uri_credentials_filter.rb
Expand Up @@ -8,6 +8,8 @@ def credential_filtered_uri(uri_to_anonymize)
return uri_to_anonymize if uri_to_anonymize.nil?
uri = uri_to_anonymize.dup
if uri.is_a?(String)
return uri if File.exist?(uri)

require_relative "vendored_uri"
uri = Bundler::URI(uri)
end
Expand Down
10 changes: 2 additions & 8 deletions bundler/spec/install/deploy_spec.rb
Expand Up @@ -361,10 +361,7 @@
bundle "config --local deployment true"
bundle :install, :raise_on_error => false
expect(err).to include("deployment mode")
# The drive letter of the Windows environment is fragile value in GitHub Actions
unless Gem.win_platform?
expect(err).to include("You have deleted from the Gemfile:\n* source: #{lib_path("rack-1.0")} (at master@#{revision_for(lib_path("rack-1.0"))[0..6]}")
end
expect(err).to include("You have deleted from the Gemfile:\n* source: #{lib_path("rack-1.0")} (at master@#{revision_for(lib_path("rack-1.0"))[0..6]}")
expect(err).not_to include("You have added to the Gemfile")
expect(err).not_to include("You have changed in the Gemfile")
end
Expand All @@ -388,10 +385,7 @@
bundle "config --local deployment true"
bundle :install, :raise_on_error => false
expect(err).to include("deployment mode")
# The drive letter of the Windows environment is fragile value in GitHub Actions
unless Gem.win_platform?
expect(err).to include("You have changed in the Gemfile:\n* rack from `no specified source` to `#{lib_path("rack")} (at master@#{revision_for(lib_path("rack"))[0..6]})`")
end
expect(err).to include("You have changed in the Gemfile:\n* rack from `no specified source` to `#{lib_path("rack")} (at master@#{revision_for(lib_path("rack"))[0..6]})`")
expect(err).not_to include("You have added to the Gemfile")
expect(err).not_to include("You have deleted from the Gemfile")
end
Expand Down
2 changes: 0 additions & 2 deletions bundler/spec/install/gemfile/git_spec.rb
Expand Up @@ -933,8 +933,6 @@
end

it "prints a friendly error if a file blocks the git repo" do
skip "drive letter is not detected correctly in error message" if Gem.win_platform?

build_git "foo"

FileUtils.mkdir_p(default_bundle_path)
Expand Down

0 comments on commit ae4ac4d

Please sign in to comment.