TLDR: /usr/local/bin/brew cask install atom is failing because it doesn't have permissions to ~/Library/Caches/Homebrew/Cask/atom
I'm running Nordstrom/chefdk_bootstrap. One of the steps is to run the homebrew::cask recipe:
Recipe: homebrew::cask
* homebrew_tap[caskroom/cask] action tap
* execute[tapping caskroom/cask] action run (skipped due to not_if)
(up to date)
* directory[/Library/Caches/Homebrew/Casks] action create (skipped due to only_if)
The install succeeds, but subsequent calls to /usr/local/bin/brew cask install fail:
$ /usr/local/bin/brew cask install atom
==> Satisfying dependencies
complete
==> Downloading https://github.com/atom/atom/releases/download/v1.11.1/atom-mac.zip
Error: Download failed on Cask 'atom' with message: Permission denied - /Users/pkaehuae/Library/Caches/Homebrew/Cask/atom--1.11.1.zip.incomplete
The workaround is to:
$ sudo chown -R $USER ~/Library/Caches/Homebrew/
While this remediates the issue, I feel like a better fix would be to add a block similar to the one below, but for ~/Library/Caches/Homebrew/ in addition to the one listed:
Cookbook version
2.1.2
Chef-client version
Chef: 12.14.89
Platform Details
OS X El Capitan Version 10.11.6
Scenario:
TLDR: /usr/local/bin/brew cask install atom is failing because it doesn't have permissions to ~/Library/Caches/Homebrew/Cask/atom
I'm running Nordstrom/chefdk_bootstrap. One of the steps is to run the homebrew::cask recipe:
The install succeeds, but subsequent calls to /usr/local/bin/brew cask install fail:
The workaround is to:
While this remediates the issue, I feel like a better fix would be to add a block similar to the one below, but for ~/Library/Caches/Homebrew/ in addition to the one listed:
https://github.com/chef-cookbooks/homebrew/blob/master/recipes/cask.rb#L23-L27
Steps to Reproduce:
/usr/local/bin/brew cask install atom
.Error: Download failed on Cask 'atom' with message: Permission denied - /Users/pkaehuae/Library/Caches/Homebrew/Cask/atom--1.11.1.zip.incomplete
sudo chown -R $USER ~/Library/Caches/Homebrew/
/usr/local/bin/brew cask install atom
Expected Result:
This is successful:
/usr/local/bin/brew cask install atom
Actual Result:
Error: Download failed on Cask 'atom' with message: Permission denied - /Users/pkaehuae/Library/Caches/Homebrew/Cask/atom--1.11.1.zip.incomplete