19 Commits

Author SHA1 Message Date
Markus Reiter
1d27c5f79a Don't create Caskroom.path for tests. 2018-06-09 11:32:49 +02:00
Markus Reiter
488149242b Remove Hbc.init. 2018-06-09 11:18:40 +02:00
Markus Reiter
3d423b0587 Add path method to Caskroom and Cache. 2018-06-09 09:52:48 +02:00
Markus Reiter
c89ae8c5ab Fall back to CaskLoader.load to get a better error message. 2018-05-26 16:05:51 +02:00
Markus Reiter
19317760da Remove Hbc::Scopes. 2018-04-14 11:45:51 +02:00
Markus Reiter
d8288eeb3a Don’t output Caskroom creation messages on non-TTY. 2017-07-26 20:30:37 +02:00
Markus Reiter
76e65ca070 Move legacy cache and caskroom code to compat/*. 2017-03-07 00:31:01 +01:00
Markus Reiter
89f4d153a2 Only show “sudo” message when it is actually needed. 2017-02-17 04:01:50 +01:00
Markus Reiter
8dd8273d5e Remove unnecessary Hbc::Locations aliases. 2016-11-10 14:48:53 +01:00
Yoshimasa Niwa
60c4328a17 Use Ruby 2.x style for named arguments. 2016-10-19 11:14:30 -07:00
Yoshimasa Niwa
5d606dd0a2 Use SystemCommand.run instead of custom wrapper.
There is an existing `SystemCommand.run` that executes command with
`sudo`.  Use that instead of yet another custom wrapper.
2016-10-15 15:19:30 -07:00
Yoshimasa Niwa
d51cd15e0c Create caskroom without sudo in writable parent.
In case the parent directory of Caskroom is writable for the user, we
don't need to use `sudo` to execute commands.

Make a generic method to run commands that has an option to switch sudo
so that we can run commands with and without sudo.
2016-10-10 11:17:07 -07:00
Yoshimasa Niwa
d00f35b8c4 FIX: cask changes /usr/local ownership recursively
Relatively old code in Hbc::Caskroom recursively changes the ownership
of the directory where the Caskroom directory exists, that changes
entire files in /usr/local to user:staff if Homebrew setup with default
configuration.
This is really dangerous because it's easy to trigger (just simply type
`brew cask something` by following some installation documentation.)

This patch removes entire `chown` with -R option and make the logic
simply creating Caskroom directory with default Homebrew directories
ownership and permission.
2016-10-09 13:27:31 -07:00
Markus Reiter
b86c8efb79 Cask: Use nested classes and modules. 2016-09-24 16:00:58 +02:00
Markus Reiter
59212445da Run rubocop —auto-correct. 2016-09-23 15:30:05 +02:00
Markus Reiter
530cee44c3 Use sudo mv to move Caskroom. 2016-09-21 19:05:35 +02:00
Markus Reiter
458a80d25a Ask for sudo when moving Caskroom. 2016-09-21 17:34:15 +02:00
Markus Reiter
6fe7019020 Make HOMEBREW_PREFIX/Caskroom the default. 2016-09-19 17:49:40 +02:00
AnastasiaSulyagina
e81f4ab7de init 2016-08-19 14:50:14 +03:00