fix(admin): AuthGen EXE 在 dist/ 子目录运行时找不到 gen-authcode.js
ScriptDir 指向 EXE 所在目录 (dist/), 但 gen-authcode.js 和 secrets.txt 在父目录。添加向上一级查找的 fallback 逻辑。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
353bbffada
commit
dba9d19129
@ -18,7 +18,13 @@ elseif ([System.Diagnostics.Process]::GetCurrentProcess().MainModule.FileName -m
|
||||
Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
} else { $PWD.Path }
|
||||
|
||||
# gen-authcode.js / secrets.txt 查找: 当前目录 → 父目录 (dist/ 内运行时)
|
||||
$GenScript = Join-Path $ScriptDir "gen-authcode.js"
|
||||
if (-not (Test-Path $GenScript)) {
|
||||
$parentDir = Split-Path $ScriptDir -Parent
|
||||
$GenScript = Join-Path $parentDir "gen-authcode.js"
|
||||
if (Test-Path $GenScript) { $ScriptDir = $parentDir } # 切到父目录
|
||||
}
|
||||
$SecretsTxt = Join-Path $ScriptDir "secrets.txt"
|
||||
|
||||
# ─── 品牌色 ───────────────────────────────────────────
|
||||
|
||||
Loading…
Reference in New Issue
Block a user