change all cn to en to avoid annoying errors

This commit is contained in:
2026-05-20 20:43:42 -04:00
parent 39c0420835
commit 25301bd60e
5 changed files with 63 additions and 70 deletions

View File

@@ -4,17 +4,15 @@ param(
)
try {
# 1. 路径预处理
# 展开环境变量 (虽然 .reg 路径通常是固定的,但支持一下没坏处)
# 1. Expand variables in the path.
$ResolvedPath = $ExecutionContext.InvokeCommand.ExpandString($Path)
# 2. 处理相对路径
# 如果路径是相对的 (./assets/...), 转换为绝对路径
# 2. Resolve relative paths from the project root.
if (-not (Test-Path $ResolvedPath) -and (Test-Path "$PWD\$ResolvedPath")) {
$ResolvedPath = Join-Path $PWD $ResolvedPath
}
# 3. 检查文件是否存在
# 3. Make sure the registry file exists.
if (-not (Test-Path $ResolvedPath)) {
Write-Warning "`n[RegImport] [Skip] Cannot find: $ResolvedPath"
return
@@ -22,8 +20,7 @@ try {
Write-Host "`n[RegImport] Importing: $(Split-Path $ResolvedPath -Leaf)" -ForegroundColor Gray
# 4. 调用 reg.exe 导入
# 使用 Start-Process 以获取退出代码
# 4. Import with reg.exe and capture the exit code.
$proc = Start-Process -FilePath "reg.exe" -ArgumentList "import", "`"$ResolvedPath`"" -Wait -PassThru -NoNewWindow
if ($proc.ExitCode -eq 0) {
@@ -34,4 +31,4 @@ try {
} catch {
Write-Error "`n[RegImport] Failed to start process: $_"
}
}