mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-12-21 21:41:29 -06:00
Simples fixes to 'Compile.ps1' Script (#2971)
* Save WinUtil's json strings with DOS-Style Newline Character (CRLF) instead of Unix-Style Newline Character (LF) Originated from PR #2816 by @ruxunderscore * Exit Early when facing Syntax Errors, Solves a problem when passing '-Run' Argument with 'Compile.ps1' Script - Use 'Out-Null' to follow common project conventions
This commit is contained in:
parent
d619ee7e85
commit
c418fe9030
@ -91,7 +91,7 @@ $($jsonAsObject | ConvertTo-Json -Depth 3)
|
|||||||
"@
|
"@
|
||||||
|
|
||||||
$sync.configs.$($psitem.BaseName) = $json | ConvertFrom-Json
|
$sync.configs.$($psitem.BaseName) = $json | ConvertFrom-Json
|
||||||
$script_content.Add($(Write-Output "`$sync.configs.$($psitem.BaseName) = @'`n$json`n'@ `| ConvertFrom-Json" ))
|
$script_content.Add($(Write-Output "`$sync.configs.$($psitem.BaseName) = @'`r`n$json`r`n'@ `| ConvertFrom-Json" ))
|
||||||
}
|
}
|
||||||
|
|
||||||
# Read the entire XAML file as a single string, preserving line breaks
|
# Read the entire XAML file as a single string, preserving line breaks
|
||||||
@ -125,10 +125,12 @@ Write-Progress -Activity "Compiling" -Completed
|
|||||||
|
|
||||||
Update-Progress -Activity "Validating" -StatusMessage "Checking winutil.ps1 Syntax" -Percent 0
|
Update-Progress -Activity "Validating" -StatusMessage "Checking winutil.ps1 Syntax" -Percent 0
|
||||||
try {
|
try {
|
||||||
$null = Get-Command -Syntax .\winutil.ps1
|
Get-Command -Syntax .\winutil.ps1 | Out-Null
|
||||||
} catch {
|
} catch {
|
||||||
Write-Warning "Syntax Validation for 'winutil.ps1' has failed"
|
Write-Warning "Syntax Validation for 'winutil.ps1' has failed"
|
||||||
Write-Host "$($Error[0])" -ForegroundColor Red
|
Write-Host "$($Error[0])" -ForegroundColor Red
|
||||||
|
Pop-Location # Restore previous location before exiting...
|
||||||
|
exit 1
|
||||||
}
|
}
|
||||||
Write-Progress -Activity "Validating" -Completed
|
Write-Progress -Activity "Validating" -Completed
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user