tests: fix under GitHub Codespaces.

This commit is contained in:
Mike McQuaid 2022-11-03 16:33:04 +00:00 committed by GitHub
parent 5ef3d76c8d
commit 2961132e01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -107,6 +107,14 @@ module Homebrew
ENV.delete(env) ENV.delete(env)
end end
# Codespaces /tmp is mounted 755 which makes Ruby warn constantly.
if (ENV["HOMEBREW_CODESPACES"] == "true") && (HOMEBREW_TEMP.to_s == "/tmp")
homebrew_prefix_tmp = "#{HOMEBREW_PREFIX}/tmp"
ENV["HOMEBREW_TEMP"] = homebrew_prefix_tmp
FileUtils.mkdir_p homebrew_prefix_tmp
system "chmod", "-R", "g-w,o-w", "/tmp"
end
ENV["HOMEBREW_NO_ANALYTICS_THIS_RUN"] = "1" ENV["HOMEBREW_NO_ANALYTICS_THIS_RUN"] = "1"
ENV["HOMEBREW_NO_COMPAT"] = "1" if args.no_compat? ENV["HOMEBREW_NO_COMPAT"] = "1" if args.no_compat?
ENV["HOMEBREW_TEST_GENERIC_OS"] = "1" if args.generic? ENV["HOMEBREW_TEST_GENERIC_OS"] = "1" if args.generic?

View File

@ -84,7 +84,7 @@ HOMEBREW_LIBRARY="${HOMEBREW_REPOSITORY}/Library"
# Copy and export all HOMEBREW_* variables previously mentioned in # Copy and export all HOMEBREW_* variables previously mentioned in
# manpage or used elsewhere by Homebrew. # manpage or used elsewhere by Homebrew.
for VAR in BAT_THEME BROWSER DISPLAY EDITOR NO_COLOR TMUX DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR for VAR in BAT_THEME BROWSER DISPLAY EDITOR NO_COLOR TMUX DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR CODESPACES
do do
# Skip if variable value is empty. # Skip if variable value is empty.
[[ -z "${!VAR}" ]] && continue [[ -z "${!VAR}" ]] && continue