add how to set ENV

This commit is contained in:
hyuraku 2021-04-23 22:56:08 +09:00
parent 5183f9aeaf
commit c67c202e54

View File

@ -3,19 +3,18 @@
#: #:
#: Install Homebrew's portable Ruby. #: Install Homebrew's portable Ruby.
source "$HOMEBREW_LIBRARY/Homebrew/utils/lock.sh" # HOMEBREW_CURLRC, HOMEBREW_LIBRARY, HOMEBREW_STDERR is from the user environment
# HOMEBREW_CACHE, HOMEBREW_CURL, HOMEBREW_LINUX, HOMEBREW_LINUX_MINIMUM_GLIBC_VERSION, HOMEBREW_MACOS, HOMEBREW_MACOS_VERSION_NUMERIC, HOMEBREW_PROCESSOR is set by brew.sh
# shellcheck disable=SC2154
source "${HOMEBREW_LIBRARY}/Homebrew/utils/lock.sh"
VENDOR_DIR="${HOMEBREW_LIBRARY}/Homebrew/vendor" VENDOR_DIR="${HOMEBREW_LIBRARY}/Homebrew/vendor"
# Built from https://github.com/Homebrew/homebrew-portable-ruby. # Built from https://github.com/Homebrew/homebrew-portable-ruby.
# #
# Dynamic variables can't be detected by shellcheck # Dynamic variables can't be detected by shellcheck
# set from user environment
# shellcheck disable=SC2034,SC2154
if [[ -n "${HOMEBREW_MACOS}" ]] if [[ -n "${HOMEBREW_MACOS}" ]]
then then
# set from user environment
# shellcheck disable=SC2154
if [[ "${HOMEBREW_PROCESSOR}" = "Intel" ]] if [[ "${HOMEBREW_PROCESSOR}" = "Intel" ]]
then then
ruby_FILENAME="portable-ruby-2.6.3_2.yosemite.bottle.tar.gz" ruby_FILENAME="portable-ruby-2.6.3_2.yosemite.bottle.tar.gz"
@ -41,8 +40,6 @@ then
fi fi
check_linux_glibc_version() { check_linux_glibc_version() {
# set from user environment
# shellcheck disable=SC2154
if [[ -z ${HOMEBREW_LINUX} || -z ${HOMEBREW_LINUX_MINIMUM_GLIBC_VERSION} ]] if [[ -z ${HOMEBREW_LINUX} || -z ${HOMEBREW_LINUX_MINIMUM_GLIBC_VERSION} ]]
then then
return 0 return 0
@ -71,8 +68,6 @@ check_linux_glibc_version() {
# Execute the specified command, and suppress stderr unless HOMEBREW_STDERR is set. # Execute the specified command, and suppress stderr unless HOMEBREW_STDERR is set.
quiet_stderr() { quiet_stderr() {
# set from user environment
# shellcheck disable=SC2154
if [[ -z "${HOMEBREW_STDERR}" ]]; then if [[ -z "${HOMEBREW_STDERR}" ]]; then
command "$@" 2>/dev/null command "$@" 2>/dev/null
else else
@ -87,8 +82,6 @@ fetch() {
curl_args=() curl_args=()
# set from user environment
# shellcheck disable=SC2154
# do not load .curlrc unless requested (must be the first argument) # do not load .curlrc unless requested (must be the first argument)
if [[ -z "${HOMEBREW_CURLRC}" ]] if [[ -z "${HOMEBREW_CURLRC}" ]]
then then
@ -112,8 +105,6 @@ fetch() {
curl_args[${#curl_args[*]}]="--progress-bar" curl_args[${#curl_args[*]}]="--progress-bar"
fi fi
# set from user environment
# shellcheck disable=SC2154
if [[ "${HOMEBREW_MACOS_VERSION_NUMERIC}" -lt "100600" ]] if [[ "${HOMEBREW_MACOS_VERSION_NUMERIC}" -lt "100600" ]]
then then
curl_args[${#curl_args[*]}]="--insecure" curl_args[${#curl_args[*]}]="--insecure"
@ -121,8 +112,6 @@ fetch() {
temporary_path="${CACHED_LOCATION}.incomplete" temporary_path="${CACHED_LOCATION}.incomplete"
# set from user environment
# shellcheck disable=SC2154
mkdir -p "${HOMEBREW_CACHE}" mkdir -p "${HOMEBREW_CACHE}"
[[ -n "${HOMEBREW_QUIET}" ]] || ohai "Downloading ${VENDOR_URL}" >&2 [[ -n "${HOMEBREW_QUIET}" ]] || ohai "Downloading ${VENDOR_URL}" >&2
if [[ -f "${CACHED_LOCATION}" ]] if [[ -f "${CACHED_LOCATION}" ]]
@ -132,8 +121,7 @@ fetch() {
if [[ -f "${temporary_path}" ]] if [[ -f "${temporary_path}" ]]
then then
# HOMEBREW_CURL is set by brew.sh (and isn't mispelt here) # HOMEBREW_CURL is set by brew.sh (and isn't mispelt here)
# shellcheck disable=SC2153 "${HOMEBREW_CURL}" "${curl_args[@]}" -C - "${VENDOR_URL}" -o "${temporary_path}"
"$HOMEBREW_CURL" "${curl_args[@]}" -C - "$VENDOR_URL" -o "$temporary_path"
if [[ $? -eq 33 ]] if [[ $? -eq 33 ]]
then then
[[ -n "${HOMEBREW_QUIET}" ]] || echo "Trying a full download" >&2 [[ -n "${HOMEBREW_QUIET}" ]] || echo "Trying a full download" >&2