This repository has been archived by the owner on Apr 14, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #6266 - nilsding:init-check-dir-writable, r=colby-swandale
[Init] Check if the current directory is writeable ### What was the end-user problem that led to this PR? The problem was that when running `bundle init` inside a directory which is not writable by the current user (e.g. `/` as demonstrated in #6219) Bundler prints out an `EACCES` error with a huge backtrace. In the mentioned PR @segiddins suggested to print out a better error message. This PR addresses that. ### What was your diagnosis of the problem? See [this comment on said PR](#6219 (comment)). ### What is your fix for the problem, implemented in this PR? My fix is simple: adding a check whether the current directory is writeable before trying to create `gems.rb`/`Gemfile`. If that's not the case, print out an error and exit. ### Why did you choose this fix out of the possible options? I chose this fix because... it was really simple to implement. (cherry picked from commit c4b022c)
- Loading branch information