Skip to content

Commit 9307ad1

Browse files
authored
Fixed the printing message. (#22301)
1 parent 9fbe42c commit 9307ad1

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

eng/scripts/Language-Settings.ps1

+11-8
Original file line numberDiff line numberDiff line change
@@ -204,24 +204,27 @@ function DockerValidation{
204204
[string]$workingDirectory
205205
)
206206
if ($PackageSourceOverride) {
207-
docker run -v "${workingDirectory}:/workdir/out" -e TARGET_PACKAGE=$packageName -e TARGET_VERSION=$packageVersion `
208-
-e EXTRA_INDEX_URL=$PackageSourceOverride -t $DocValidationImageId 2>&1 | Out-Null
207+
Write-Host "docker run -v ${workingDirectory}:/workdir/out -e TARGET_PACKAGE=$packageName -e TARGET_VERSION=$packageVersion -e EXTRA_INDEX_URL=$PackageSourceOverride -t $DocValidationImageId"
208+
$commandLine = docker run -v "${workingDirectory}:/workdir/out" -e TARGET_PACKAGE=$packageName -e TARGET_VERSION=$packageVersion `
209+
-e EXTRA_INDEX_URL=$PackageSourceOverride -t $DocValidationImageId 2>&1
209210
}
210211
else {
211-
docker run -v "${workingDirectory}:/workdir/out" `
212-
-e TARGET_PACKAGE=$packageName -e TARGET_VERSION=$packageVersion -t $DocValidationImageId 2>&1 | Out-Null
212+
Write-Host "docker run -v ${workingDirectory}:/workdir/out -e TARGET_PACKAGE=$packageName -e TARGET_VERSION=$packageVersion -t $DocValidationImageId"
213+
$commandLine = docker run -v "${workingDirectory}:/workdir/out" `
214+
-e TARGET_PACKAGE=$packageName -e TARGET_VERSION=$packageVersion -t $DocValidationImageId 2>&1
213215
}
214216
# The docker exit codes: https://docs.docker.com/engine/reference/run/#exit-status
215217
# If the docker failed because of docker itself instead of the application,
216218
# we should skip the validation and keep the packages.
219+
217220
if ($LASTEXITCODE -eq 125 -Or $LASTEXITCODE -eq 126 -Or $LASTEXITCODE -eq 127) {
218-
Write-Host $commandLine
221+
$commandLine | ForEach-Object { Write-Debug $_ }
219222
LogWarning "The `docker` command does not work with exit code $LASTEXITCODE. Fall back to npm install $packageName directly."
220223
FallbackValidation -packageName "$packageName" -packageVersion "$packageVersion" -workingDirectory $workingDirectory -PackageSourceOverride $PackageSourceOverride
221224
}
222225
elseif ($LASTEXITCODE -ne 0) {
223-
Write-Host $commandLine
224-
LogWarning "Package $($Package.name) ref docs validation failed."
226+
$commandLine | ForEach-Object { Write-Debug $_ }
227+
LogWarning "Package $packageName ref docs validation failed."
225228
return $false
226229
}
227230
return $true
@@ -566,4 +569,4 @@ function Validate-Python-DocMsPackages ($PackageInfo, $PackageSourceOverride, $D
566569
$packageVersion = $packageInfo.Version
567570
ValidatePackage -packageName $packageName -packageVersion $packageVersion `
568571
-PackageSourceOverride $PackageSourceOverride -DocValidationImageId $DocValidationImageId
569-
}
572+
}

0 commit comments

Comments
 (0)