puppet-homebrew icon indicating copy to clipboard operation
puppet-homebrew copied to clipboard

Notify error when brew user has no privileges on cwd

Open sp-ricard-valverde opened this issue 7 years ago • 1 comments

After reporting the original problem with brew here and getting closed without resolution I guess something could be done at least on this module's side.

The problem is, if running puppet apply with sudo and from a private folder, when Homebrew tries to install the packages as the Homebrew unprivileged user, it fails. When it fails this way, the puppet module does not catch this particular permission error and continues execution, in the end leading to errors like Error: Could not find package: <name>.

I think It should be useful to preventively report an error in the lines:

raise Puppet::ExecutionFailure, "Homebrew user has no privileges on the current folder #{pwd}"

sp-ricard-valverde avatar Sep 07 '18 11:09 sp-ricard-valverde

Linking to #101 as a partial dupe.

TheKevJames avatar Sep 07 '18 18:09 TheKevJames