| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  | # frozen_string_literal: true | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | module Homebrew | 
					
						
							| 
									
										
										
										
											2020-08-14 04:35:58 +02:00
										 |  |  |   # Helper module for querying Homebrew-specific environment variables. | 
					
						
							|  |  |  |   # | 
					
						
							|  |  |  |   # @api private | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |   module EnvConfig | 
					
						
							|  |  |  |     module_function | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ENVS = { | 
					
						
							|  |  |  |       HOMEBREW_ARCH:                      { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "Linux only: Pass the set value to a type name representing the compiler's `-march` option.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |         default:     "native", | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_ARTIFACT_DOMAIN:           { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "Prefix all download URLs, including those for bottles, with this " \ | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |                      "variable. For example, `HOMEBREW_ARTIFACT_DOMAIN=http://localhost:8080` will cause a " \ | 
					
						
							|  |  |  |                      "formula with the URL `https://example.com/foo.tar.gz` to instead download from " \ | 
					
						
							|  |  |  |                      "`http://localhost:8080/example.com/foo.tar.gz`.", | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_AUTO_UPDATE_SECS:          { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "Automatically check for updates once per this seconds interval.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |         default:     300, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_BAT:                       { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "If set, use `bat` for the `brew cat` command.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |         boolean:     true, | 
					
						
							|  |  |  |       }, | 
					
						
							| 
									
										
										
										
											2020-05-02 18:21:36 +01:00
										 |  |  |       HOMEBREW_BAT_CONFIG_PATH:           { | 
					
						
							|  |  |  |         description:  "Use the `bat` configuration file. For example, `HOMEBREW_BAT=$HOME/.bat/config`.", | 
					
						
							|  |  |  |         default_text: "$HOME/.bat/config", | 
					
						
							|  |  |  |       }, | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |       HOMEBREW_BINTRAY_KEY:               { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "Use this API key when accessing the Bintray API (where bottles are stored).", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_BINTRAY_USER:              { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "Use this username when accessing the Bintray API (where bottles are stored).", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_BOTTLE_DOMAIN:             { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description:  "Use the specified URL as the download mirror for bottles. " \ | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |         "For example, `HOMEBREW_BOTTLE_DOMAIN=http://localhost:8080` will cause all bottles to " \ | 
					
						
							|  |  |  |         "download from the prefix `http://localhost:8080/`.", | 
					
						
							|  |  |  |         default_text: "macOS: `https://homebrew.bintray.com/`, Linux: `https://linuxbrew.bintray.com/`.", | 
					
						
							|  |  |  |         default:      HOMEBREW_BOTTLE_DEFAULT_DOMAIN, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_BREW_GIT_REMOTE:           { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "Use the specified URL as the Homebrew/brew `git`(1) remote.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |         default:     HOMEBREW_BREW_DEFAULT_GIT_REMOTE, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_BROWSER:                   { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description:  "Use this as the browser when opening project homepages.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |         default_text: "`$BROWSER` or the OS's default browser.", | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_CACHE:                     { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description:  "Use the specified directory as the download cache.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |         default_text: "macOS: `$HOME/Library/Caches/Homebrew`, " \ | 
					
						
							|  |  |  |                       "Linux: `$XDG_CACHE_HOME/Homebrew` or `$HOME/.cache/Homebrew`.", | 
					
						
							|  |  |  |         default:      HOMEBREW_DEFAULT_CACHE, | 
					
						
							|  |  |  |       }, | 
					
						
							| 
									
										
										
										
											2020-08-05 11:50:01 +02:00
										 |  |  |       HOMEBREW_CASK_OPTS:                 { | 
					
						
							| 
									
										
										
										
											2020-08-01 02:30:46 +02:00
										 |  |  |         description: "Options which should be used for all `cask` commands. All `--*dir` options, " \ | 
					
						
							|  |  |  |                      "`--language`, `--require-sha`, `--no-quarantine` and `--no-binaries` are supported." \ | 
					
						
							|  |  |  |                      "\n" \ | 
					
						
							|  |  |  |                      "For example, you might add something like the following to your " \ | 
					
						
							|  |  |  |                      "~/.profile, ~/.bash_profile, or ~/.zshenv:\n\n" \ | 
					
						
							|  |  |  |                      "`export HOMEBREW_CASK_OPTS='--appdir=~/Applications --fontdir=/Library/Fonts'`", | 
					
						
							| 
									
										
										
										
											2020-08-05 11:50:01 +02:00
										 |  |  |       }, | 
					
						
							| 
									
										
										
										
											2020-04-20 10:33:15 +01:00
										 |  |  |       HOMEBREW_CLEANUP_MAX_AGE_DAYS:      { | 
					
						
							|  |  |  |         description: "Cleanup all cached files older than this many days.", | 
					
						
							|  |  |  |         default:     120, | 
					
						
							|  |  |  |       }, | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |       HOMEBREW_COLOR:                     { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "If set, force colour output on non-TTY outputs.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |         boolean:     true, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_CORE_GIT_REMOTE:           { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description:  "Use the specified URL as the Homebrew/homebrew-core `git`(1) remote.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |         default_text: "macOS: `https://github.com/Homebrew/homebrew-core`, " \ | 
					
						
							|  |  |  |                       "Linux: `https://github.com/Homebrew/linuxbrew-core`.", | 
					
						
							|  |  |  |         default:      HOMEBREW_CORE_DEFAULT_GIT_REMOTE, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_CURLRC:                    { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "If set, do not pass `--disable` when invoking `curl`(1), which disables the " \ | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |                      "use of `curlrc`.", | 
					
						
							|  |  |  |         boolean:     true, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_CURL_RETRIES:              { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "Pass the given retry count to `--retry` when invoking `curl`(1).", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |         default:     3, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_CURL_VERBOSE:              { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "If set, pass `--verbose` when invoking `curl`(1).", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |         boolean:     true, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_DEVELOPER:                 { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "If set, tweak behaviour to be more relevant for Homebrew developers (active or " \ | 
					
						
							|  |  |  |                      "budding) by e.g. turning warnings into errors.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |         boolean:     true, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_DISABLE_LOAD_FORMULA:      { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "If set, refuse to load formulae. This is useful when formulae are not trusted (such " \ | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |                      "as in pull requests).", | 
					
						
							|  |  |  |         boolean:     true, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_DISPLAY:                   { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description:  "Use this X11 display when opening a page in a browser, for example with " \ | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |                      "`brew home`. Primarily useful on Linux.", | 
					
						
							|  |  |  |         default_text: "`$DISPLAY`.", | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_DISPLAY_INSTALL_TIMES:     { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "If set, print install times for each formula at the end of the run.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |         boolean:     true, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_EDITOR:                    { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description:  "Use this editor when editing a single formula, or several formulae in the " \ | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |                      "same directory.\n\n    *Note:* `brew edit` will open all of Homebrew as discontinuous files " \ | 
					
						
							|  |  |  |                      "and directories. Visual Studio Code can handle this correctly in project mode, but many " \ | 
					
						
							|  |  |  |                      "editors will do strange things in this case.", | 
					
						
							|  |  |  |         default_text: "`$EDITOR` or `$VISUAL`.", | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_FAIL_LOG_LINES:            { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "Output this many lines of output on formula `system` failures.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |         default:     15, | 
					
						
							|  |  |  |       }, | 
					
						
							| 
									
										
										
										
											2020-07-01 21:45:47 +08:00
										 |  |  |       HOMEBREW_FORBIDDEN_LICENSES:        { | 
					
						
							| 
									
										
										
										
											2020-07-09 17:42:08 +08:00
										 |  |  |         description: "A space-separated list of licenses. Homebrew will refuse to install a " \ | 
					
						
							|  |  |  |         "formula if that formula or any of its dependencies has a license on this list.", | 
					
						
							| 
									
										
										
										
											2020-07-01 21:45:47 +08:00
										 |  |  |       }, | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |       HOMEBREW_FORCE_BREWED_CURL:         { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "If set, always use a Homebrew-installed `curl`(1) rather than the system version. " \ | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |                      "Automatically set if the system version of `curl` is too old.", | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         boolean:     true, | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_FORCE_BREWED_GIT:          { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "If set, always use a Homebrew-installed `git`(1) rather than the system version. " \ | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |                      "Automatically set if the system version of `git` is too old.", | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         boolean:     true, | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_FORCE_HOMEBREW_ON_LINUX:   { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "If set, running Homebrew on Linux will use URLs for macOS. This is useful when merging " \ | 
					
						
							|  |  |  |                      "pull requests for macOS while on Linux.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |         boolean:     true, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_FORCE_VENDOR_RUBY:         { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "If set, always use Homebrew's vendored, relocatable Ruby version even if the system version " \ | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |                      "of Ruby is new enough.", | 
					
						
							|  |  |  |         boolean:     true, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_GITHUB_API_PASSWORD:       { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "Use this password for authentication with the GitHub API, for features " \ | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |                      "such as `brew search`. We strongly recommend using `HOMEBREW_GITHUB_API_TOKEN` instead.", | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_GITHUB_API_TOKEN:          { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "Use this personal access token for the GitHub API, for features such as " \ | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |                      "`brew search`. You can create one at <https://github.com/settings/tokens>. If set, " \ | 
					
						
							|  |  |  |                      "GitHub will allow you a greater number of API requests. For more information, see: " \ | 
					
						
							| 
									
										
										
										
											2020-08-12 23:51:12 -04:00
										 |  |  |                      "<https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting>.\n\n" \ | 
					
						
							|  |  |  |                      "    *Note:* Homebrew doesn't require permissions for any of the scopes, but some developer " \ | 
					
						
							|  |  |  |                      "commands may require additional permissions.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_GITHUB_API_USERNAME:       { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "Use this username for authentication with the GitHub API, for features " \ | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |                      "such as `brew search`. We strongly recommend using `HOMEBREW_GITHUB_API_TOKEN` instead.", | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_GIT_EMAIL:                 { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "Set the Git author and committer name to this value.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_GIT_NAME:                  { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "Set the Git author and committer email to this value.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_INSTALL_BADGE:             { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description:  "Print this text before the installation summary of each successful build.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |         default_text: 'The "Beer Mug" emoji.', | 
					
						
							|  |  |  |         default:      "🍺", | 
					
						
							|  |  |  |       }, | 
					
						
							| 
									
										
										
										
											2020-08-02 00:59:36 +05:30
										 |  |  |       HOMEBREW_LIVECHECK_WATCHLIST:       { | 
					
						
							|  |  |  |         description: "Use this file to get the list of default Formulae to check when no Formula argument " \ | 
					
						
							|  |  |  |                      "is passed to `brew livecheck`", | 
					
						
							|  |  |  |         default:     "$HOME/.brew_livecheck_watchlist", | 
					
						
							|  |  |  |       }, | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |       HOMEBREW_LOGS:                      { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description:  "Use the specified directory to store log files.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |         default_text: "macOS: `$HOME/Library/Logs/Homebrew`, "\ | 
					
						
							|  |  |  |                       "Linux: `$XDG_CACHE_HOME/Homebrew/Logs` or `$HOME/.cache/Homebrew/Logs`.", | 
					
						
							|  |  |  |         default:      HOMEBREW_DEFAULT_LOGS, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_MAKE_JOBS:                 { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description:  "Use this value as the number of parallel jobs to run when building with `make`(1).", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |         default_text: "The number of available CPU cores.", | 
					
						
							|  |  |  |         default:      lambda { | 
					
						
							|  |  |  |           require "os" | 
					
						
							|  |  |  |           require "hardware" | 
					
						
							|  |  |  |           Hardware::CPU.cores | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_NO_ANALYTICS:              { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "If set, do not send analytics. See: <https://docs.brew.sh/Analytics>.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |         boolean:     true, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_NO_AUTO_UPDATE:            { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "If set, do not automatically update before running " \ | 
					
						
							|  |  |  |                      "`brew install`, `brew upgrade` or `brew tap`.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |         boolean:     true, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "If set, fail on the failure of installation from a bottle rather than " \ | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |                      "falling back to building from source.", | 
					
						
							|  |  |  |         boolean:     true, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_NO_COLOR:                  { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description:  "If set, do not print text with colour added.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |         default_text: "`$NO_COLOR`.", | 
					
						
							|  |  |  |         boolean:      true, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_NO_COMPAT:                 { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "If set, disable all use of legacy compatibility code.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |         boolean:     true, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_NO_EMOJI:                  { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "If set, do not print `HOMEBREW_INSTALL_BADGE` on a successful build." \ | 
					
						
							|  |  |  |                      "\n\n    *Note:* Only tries to print emoji on OS X Lion or newer.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |         boolean:     true, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_NO_GITHUB_API:             { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "If set, do not use the GitHub API, e.g. for searches or fetching relevant issues " \ | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |                      "on a failed install.", | 
					
						
							|  |  |  |         boolean:     true, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_NO_INSECURE_REDIRECT:      { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "If set, forbid redirects from secure HTTPS to insecure HTTP." \ | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |                      "\n\n    *Note:* While ensuring your downloads are fully secure, this is likely to cause " \ | 
					
						
							|  |  |  |                      "from-source SourceForge, some GNU & GNOME based formulae to fail to download.", | 
					
						
							|  |  |  |         boolean:     true, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_NO_INSTALL_CLEANUP:        { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "If set, `brew install`, `brew upgrade` and `brew reinstall` will never automatically " \ | 
					
						
							|  |  |  |                      "cleanup installed/upgraded/reinstalled formulae or all formulae every 30 days.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |         boolean:     true, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_PRY:                       { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "If set, use Pry for the `brew irb` command.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |         boolean:     true, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_SKIP_OR_LATER_BOTTLES:     { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "If set with `HOMEBREW_DEVELOPER`, do not use bottles from older versions " \ | 
					
						
							|  |  |  |                      "of macOS. This is useful in development on new macOS versions.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |         boolean:     true, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_SVN:                       { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description:  "Use this as the `svn`(1) binary.", | 
					
						
							|  |  |  |         default_text: "A Homebrew-built Subversion (if installed), or the system-provided binary.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_TEMP:                      { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description:  "Use this path as the temporary directory for building packages. Changing " \ | 
					
						
							|  |  |  |                       "this may be needed if your system temporary directory and Homebrew prefix are on " \ | 
					
						
							|  |  |  |                       "different volumes, as macOS has trouble moving symlinks across volumes when the target " \ | 
					
						
							|  |  |  |                       "does not yet exist. This issue typically occurs when using FileVault or custom SSD " \ | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |                       "configurations.", | 
					
						
							|  |  |  |         default_text: "macOS: `/private/tmp`, Linux: `/tmp`.", | 
					
						
							|  |  |  |         default:      HOMEBREW_DEFAULT_TEMP, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_UPDATE_TO_TAG:             { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "If set, always use the latest stable tag (even if developer commands " \ | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |                      "have been run).", | 
					
						
							|  |  |  |         boolean:     true, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       HOMEBREW_VERBOSE:                   { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "If set, always assume `--verbose` when running commands.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |         boolean:     true, | 
					
						
							|  |  |  |       }, | 
					
						
							| 
									
										
										
										
											2020-09-03 19:44:32 +02:00
										 |  |  |       HOMEBREW_DEBUG:                     { | 
					
						
							|  |  |  |         description: "If set, always assume `--debug` when running commands.", | 
					
						
							|  |  |  |         boolean:     true, | 
					
						
							|  |  |  |       }, | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |       HOMEBREW_VERBOSE_USING_DOTS:        { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "If set, verbose output will print a `.` no more than once a minute. This can be " \ | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |                      "useful to avoid long-running Homebrew commands being killed due to no output.", | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         boolean:     true, | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |       }, | 
					
						
							|  |  |  |       all_proxy:                          { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "Use this SOCKS5 proxy for `curl`(1), `git`(1) and `svn`(1) when downloading through Homebrew.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |       }, | 
					
						
							|  |  |  |       ftp_proxy:                          { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "Use this FTP proxy for `curl`(1), `git`(1) and `svn`(1) when downloading through Homebrew.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |       }, | 
					
						
							|  |  |  |       http_proxy:                         { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "Use this HTTP proxy for `curl`(1), `git`(1) and `svn`(1) when downloading through Homebrew.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |       }, | 
					
						
							|  |  |  |       https_proxy:                        { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "Use this HTTPS proxy for `curl`(1), `git`(1) and `svn`(1) when downloading through Homebrew.", | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |       }, | 
					
						
							|  |  |  |       no_proxy:                           { | 
					
						
							| 
									
										
										
										
											2020-04-09 19:33:50 +10:00
										 |  |  |         description: "A comma-separated list of hostnames and domain names excluded " \ | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |                      "from proxying by `curl`(1), `git`(1) and `svn`(1) when downloading through Homebrew.", | 
					
						
							|  |  |  |       }, | 
					
						
							| 
									
										
										
										
											2020-08-01 02:30:46 +02:00
										 |  |  |       SUDO_ASKPASS:                       { | 
					
						
							|  |  |  |         description: "When this variable is set, the `-A` option is passed when calling `sudo`(8)", | 
					
						
							|  |  |  |       }, | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |     }.freeze | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def env_method_name(env, hash) | 
					
						
							|  |  |  |       method_name = env.to_s | 
					
						
							|  |  |  |                        .sub(/^HOMEBREW_/, "") | 
					
						
							|  |  |  |                        .downcase | 
					
						
							|  |  |  |       method_name = "#{method_name}?" if hash[:boolean] | 
					
						
							|  |  |  |       method_name | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ENVS.each do |env, hash| | 
					
						
							|  |  |  |       method_name = env_method_name(env, hash) | 
					
						
							|  |  |  |       env = env.to_s | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       if hash[:boolean] | 
					
						
							|  |  |  |         define_method(method_name) do | 
					
						
							|  |  |  |           ENV[env].present? | 
					
						
							|  |  |  |         end | 
					
						
							|  |  |  |       elsif hash[:default].present? | 
					
						
							|  |  |  |         # Needs a custom implementation. | 
					
						
							| 
									
										
										
										
											2020-08-05 11:50:01 +02:00
										 |  |  |         next if ["HOMEBREW_MAKE_JOBS", "HOMEBREW_CASK_OPTS"].include?(env) | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |         define_method(method_name) do | 
					
						
							|  |  |  |           ENV[env].presence || hash.fetch(:default).to_s | 
					
						
							|  |  |  |         end | 
					
						
							|  |  |  |       else | 
					
						
							|  |  |  |         define_method(method_name) do | 
					
						
							|  |  |  |           ENV[env].presence | 
					
						
							|  |  |  |         end | 
					
						
							|  |  |  |       end | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     # Needs a custom implementation. | 
					
						
							|  |  |  |     def make_jobs | 
					
						
							|  |  |  |       jobs = ENV["HOMEBREW_MAKE_JOBS"].to_i | 
					
						
							|  |  |  |       return jobs.to_s if jobs.positive? | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       ENVS.fetch(:HOMEBREW_MAKE_JOBS) | 
					
						
							|  |  |  |           .fetch(:default) | 
					
						
							|  |  |  |           .call | 
					
						
							|  |  |  |           .to_s | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2020-08-05 11:50:01 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def cask_opts | 
					
						
							|  |  |  |       Shellwords.shellsplit(ENV.fetch("HOMEBREW_CASK_OPTS", "")) | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-05 10:28:58 -04:00
										 |  |  |     def cask_opts_binaries? | 
					
						
							|  |  |  |       cask_opts.reverse_each do |opt| | 
					
						
							|  |  |  |         return true if opt == "--binaries" | 
					
						
							|  |  |  |         return false if opt == "--no-binaries" | 
					
						
							|  |  |  |       end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       true | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-05 11:50:01 +02:00
										 |  |  |     def cask_opts_quarantine? | 
					
						
							|  |  |  |       cask_opts.reverse_each do |opt| | 
					
						
							|  |  |  |         return true if opt == "--quarantine" | 
					
						
							|  |  |  |         return false if opt == "--no-quarantine" | 
					
						
							|  |  |  |       end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       true | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def cask_opts_require_sha? | 
					
						
							|  |  |  |       cask_opts.include?("--require-sha") | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2020-04-05 15:43:59 +01:00
										 |  |  |   end | 
					
						
							|  |  |  | end |