From 2a3fd2a382ac82c2e0e7cd404c208fb21bdd4bf1 Mon Sep 17 00:00:00 2001 From: Nick Cooke <36927374+ncooke3@users.noreply.github.com> Date: Tue, 26 Dec 2023 19:00:25 -0500 Subject: [PATCH] [Release Tooling] Stop sourcing .bash_profile when running generated shell scripts (#12159) --- ReleaseTooling/Sources/Utils/ShellUtils.swift | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ReleaseTooling/Sources/Utils/ShellUtils.swift b/ReleaseTooling/Sources/Utils/ShellUtils.swift index e3fe860cded..b2ea9a2870b 100644 --- a/ReleaseTooling/Sources/Utils/ShellUtils.swift +++ b/ReleaseTooling/Sources/Utils/ShellUtils.swift @@ -62,16 +62,9 @@ public extension Shell { // Write the temporary script contents to the script's path. CocoaPods complains when LANG // isn't set in the environment, so explicitly set it here. The `/usr/local/git/current/bin` // is to allow the `sso` protocol if it's there. - // The user's .bash_profile, if it exists, is sourced to modify the - // shell's PATH with any configuration (e.g. adding Ruby to path) - // that may be needed to run the given command. let contents = """ export PATH="/usr/local/bin:/usr/local/git/current/bin:$PATH" export LANG="en_US.UTF-8" - BASH_PROFILE_PATH="~/.bash_profile" - if [ -f "$BASH_PROFILE_PATH" ]; then - source $BASH_PROFILE_PATH - fi \(command) """ try contents.write(to: scriptPath, atomically: true, encoding: .utf8)