Module: OS::Linux::Cask::Caskroom::ClassMethods Private
- Defined in:
- extend/os/linux/cask/caskroom.rb
This module is part of a private API. This module may only be used in the Homebrew/brew repository. Third parties should avoid using this module if possible, as it may be removed or changed without warning.
Instance Method Summary collapse
-
#expected_caskroom_group ⇒ String
private
Unlike macOS (which uses the
admingroup), Homebrew on Linux is run in a variety of distributions, so use the current user's primary group as the group of theCaskroomdirectory.
Instance Method Details
#expected_caskroom_group ⇒ String
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
Unlike macOS (which uses the admin group), Homebrew on Linux is run
in a variety of distributions, so use the current user's primary group
as the group of the Caskroom directory.
This avoids a sudo prompt to chgrp the directory after creation.
14 15 16 17 18 19 20 21 22 23 |
# File 'extend/os/linux/cask/caskroom.rb', line 14 def expected_caskroom_group @expected_caskroom_group ||= T.let( begin Etc.getgrgid(Process.egid)&.name || "root" rescue ArgumentError "root" end, T.nilable(String), ) end |