Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ask for sudo when moving Caskroom. #1064

Merged
merged 2 commits into from Sep 22, 2016

Conversation

reitermarkus
Copy link
Member

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew tests with your changes locally?

Addresses Homebrew/homebrew-cask#24674, since people need to run sudo chown anyway, so might as well prompt them to.

@Homebrew/cask

@MikeMcQuaid
Copy link
Member

Could you tell people to change it back afterwards? Also, how would you feel about printing a message with either the command to run and letting them do it themselves or, alternatively, the command you're about to run before you run it?


unless Hbc.caskroom.parent.writable?
opoo "#{Hbc.caskroom.parent} is not writable, changing owner to current user."
system "/usr/bin/sudo", "--", "/usr/sbin/chown", "--", "#{Hbc::Utils.current_user}:staff", Hbc.caskroom.parent.to_s
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brought me back to when we used to have to do something similar when using /opt.

@reitermarkus
Copy link
Member Author

We could alternatively use sudo mv instead of chmodding /usr/local, this way we don't need to change the permissions back.

@reitermarkus reitermarkus merged commit c310557 into Homebrew:master Sep 22, 2016
@reitermarkus reitermarkus deleted the migrate-caskroom branch September 22, 2016 08:20
@Homebrew Homebrew locked and limited conversation to collaborators May 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants