refactor(windows scripts): remove BOM and improve UTF-8 handling
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
LXS - Tools index (Windows)
|
||||
Description: Interactive menu listing the scripts in windows\tools
|
||||
Repo: https://git.hyko.cx/hykocx/lxs
|
||||
@@ -19,7 +19,10 @@ if ($LxsLibPath -and (Test-Path $LxsLibPath)) {
|
||||
Write-Error 'Failed to fetch lib/common.ps1'
|
||||
exit 1
|
||||
}
|
||||
. ([scriptblock]::Create($LxsLibSource))
|
||||
# The library ships with a UTF-8 BOM (Windows PowerShell 5.1 needs it to
|
||||
# read the file as UTF-8); over HTTP that BOM arrives as a leading U+FEFF
|
||||
# character, which the parser will not accept.
|
||||
. ([scriptblock]::Create(($LxsLibSource -replace '^\uFEFF', '')))
|
||||
}
|
||||
|
||||
function Show-LxsToolsMenu {
|
||||
@@ -66,7 +69,7 @@ function Show-LxsToolsMenu {
|
||||
$code = Invoke-LxsSibling -RelativePath $script -SelfDirectory $PSScriptRoot
|
||||
|
||||
# Exit code 75 from a child means it already paused on its own
|
||||
# (its own "Back" or end-of-run prompt) — skip the redundant prompt.
|
||||
# (its own "Back" or end-of-run prompt) - skip the redundant prompt.
|
||||
if ($code -ne 75) { Read-LxsEnter }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user