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

Commit

Permalink
warn if read-only filesystem
Browse files Browse the repository at this point in the history
  • Loading branch information
jlambert121 committed Feb 10, 2017
1 parent 1f99317 commit 212be05
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bundler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def tmp_home_path(login, warning)
tmp_home_path.join(login).tap(&:mkpath)
end
rescue => e
raise "#{warning}\nBundler also failed to create a temporary home directory at `#{path}':\n#{e}"
Bundler.ui.warn "#{warning}\nBundler also failed to create a temporary home directory at `#{path}':\n#{e}"
end

def user_bundle_path
Expand Down
5 changes: 5 additions & 0 deletions spec/bundler/bundler_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,5 +208,10 @@
expect(File).to receive(:chmod).with(0o777, "/TMP/bundler/home")
expect(Bundler.tmp_home_path("USER", "")).to eq(Pathname("/TMP/bundler/home/USER"))
end

it "should warn on r/o filesystem" do
allow(SharedHelpers).to receive(:filesystem_access).and_raise(PermissionError.new('/tmp'))
expect(Bundler.ui).to receive(:warn).with("AAA\nBundler also failed to create a temporary home directory at `AAA':\nAAA")
end
end
end

0 comments on commit 212be05

Please sign in to comment.