mirror of
https://github.com/actions/go-versions.git
synced 2026-02-17 07:51:35 +00:00
rename variable
This commit is contained in:
@@ -21,7 +21,7 @@ Describe "Go" {
|
|||||||
if (-not [string]::IsNullOrEmpty($resolvedPath) -and (Test-Path $resolvedPath)) {
|
if (-not [string]::IsNullOrEmpty($resolvedPath) -and (Test-Path $resolvedPath)) {
|
||||||
if ($logsFolderPath -eq "actions-runner/cached/_diag/pages") {
|
if ($logsFolderPath -eq "actions-runner/cached/_diag/pages") {
|
||||||
try {
|
try {
|
||||||
$useNodeLogFile = Get-ChildItem -Path $logsFolderPath -File| Where-Object {
|
$useGoLogFile = Get-ChildItem -Path $logsFolderPath -File| Where-Object {
|
||||||
if (-not $_.PSIsContainer) { # Ensure it's not a directory
|
if (-not $_.PSIsContainer) { # Ensure it's not a directory
|
||||||
$logContent = Get-Content $_.Fullname -Raw
|
$logContent = Get-Content $_.Fullname -Raw
|
||||||
return $logContent -match "setup-go@v"
|
return $logContent -match "setup-go@v"
|
||||||
@@ -31,7 +31,7 @@ Describe "Go" {
|
|||||||
Write-Error "Failed to resolve path: $logsFolderPath"
|
Write-Error "Failed to resolve path: $logsFolderPath"
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$useNodeLogFile = Get-ChildItem -Path $resolvedPath | Where-Object {
|
$useGoLogFile = Get-ChildItem -Path $resolvedPath | Where-Object {
|
||||||
if (-not $_.PSIsContainer) { # Ensure it's not a directory
|
if (-not $_.PSIsContainer) { # Ensure it's not a directory
|
||||||
$logContent = Get-Content $_.Fullname -Raw
|
$logContent = Get-Content $_.Fullname -Raw
|
||||||
return $logContent -match "setup-go@v"
|
return $logContent -match "setup-go@v"
|
||||||
@@ -40,8 +40,8 @@ Describe "Go" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Return the file name if a match is found
|
# Return the file name if a match is found
|
||||||
if ($useNodeLogFile) {
|
if ($useGoLogFile) {
|
||||||
return $useNodeLogFile.FullName
|
return $useGoLogFile.FullName
|
||||||
} else {
|
} else {
|
||||||
Write-Error "No matching log file found in the specified path."
|
Write-Error "No matching log file found in the specified path."
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user