From e673c5559253503dbcb1fc7bcbb2da890d08b1d4 Mon Sep 17 00:00:00 2001 From: Aaron Klotz Date: Mon, 11 Aug 2025 12:25:48 -0600 Subject: [PATCH] use script scope for copying args Signed-off-by: Aaron Klotz --- tool/gocross/gocross-wrapper.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tool/gocross/gocross-wrapper.ps1 b/tool/gocross/gocross-wrapper.ps1 index ff951bf21..51ba3f9b7 100644 --- a/tool/gocross/gocross-wrapper.ps1 +++ b/tool/gocross/gocross-wrapper.ps1 @@ -4,12 +4,12 @@ $ErrorActionPreference = 'Stop' <# .DESCRIPTION - Copies the global $args variable into an array, which is easier to work with + Copies the script's $args variable into an array, which is easier to work with when preparing to start child processes. #> -function Copy-GlobalArgs { - $list = [System.Collections.Generic.List[string]]::new($Global:args.Count) - foreach ($arg in $Global:args) { +function Copy-ScriptArgs { + $list = [System.Collections.Generic.List[string]]::new($Script:args.Count) + foreach ($arg in $Script:args) { $list.Add($arg) } return $list.ToArray() @@ -189,7 +189,7 @@ $repoRoot = Get-RepoRoot $execEnv = Copy-Environment $execEnv.Remove('GOROOT') -$argList = Copy-GlobalArgs +$argList = Copy-ScriptArgs if ($Env:TS_USE_GOCROSS -ne '1') { $revFile = Join-Path $repoRoot 'go.toolchain.rev' -Resolve