Skip to content

Commit

Permalink
Update pws script (#1656)
Browse files Browse the repository at this point in the history
  • Loading branch information
FlaviuTritean authored Oct 7, 2024
1 parent 485b640 commit 87e3d1d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions build/PowerShellScripts/GenerateReportForCompileTimeError.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ Get-Content $logFile | ForEach-Object {
$inBuildFailedSection = $false
}
}

if (Test-Path $reportFile) {
$fileContent = Get-Content $reportFile
if ($fileContent.Length -gt 0) {
# Define file paths
$inputFile = "$directoryPath\DemoReport.txt" # Path to the input file
$outputFile = "$directoryPath\DemoReportWithTitle.txt" # Path to the output file
Expand All @@ -68,6 +70,8 @@ $processedLine = $false
# Clear the output file if it already exists
Clear-Content -Path $outputFile -ErrorAction Ignore



# Read the input file line by line
Get-Content $inputFile | ForEach-Object {
$line = $_
Expand Down Expand Up @@ -202,7 +206,7 @@ Get-Content $input5 | ForEach-Object {
$line = $_

# If the line contains "(s)", replace it with an empty line
if ($line -match "Warning\(s\)|Error\(s\)") {
if ($line -match "Warning\(s\)|Error\(s\)|MSB3822") {
Add-Content -Path $output5 -Value ""
} else {
# Otherwise, write the line as it is
Expand Down Expand Up @@ -230,4 +234,6 @@ Get-Content $input6 | ForEach-Object {

# Write the modified or original line to the output file
Add-Content -Path $output6 -Value $line
}
}
}

0 comments on commit 87e3d1d

Please sign in to comment.