From 9f4363cdbbec36f80729af9c99dcabd29293c6b5 Mon Sep 17 00:00:00 2001 From: gahusb Date: Wed, 13 May 2026 07:31:48 +0900 Subject: [PATCH] =?UTF-8?q?fix(deploy):=20PowerShell=20single-quote=20lite?= =?UTF-8?q?ral=EB=A1=9C=20path=20=EC=A0=84=EB=8B=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 기존 replace(/\/g, "\\\\") + double-quote escape 패턴이 PowerShell -Command 컨텍스트에서 한 번 더 escape돼 백슬래시가 두 개씩으로 부풀려져 Test-Path가 실패하던 케이스 fix. single-quote로 raw literal 전달 — env override(NAS_FRONTEND_DEST_WIN)가 의도대로 그대로 적용됨. --- scripts/deploy-nas.cjs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/deploy-nas.cjs b/scripts/deploy-nas.cjs index 9f57620..ef5ef1e 100644 --- a/scripts/deploy-nas.cjs +++ b/scripts/deploy-nas.cjs @@ -33,10 +33,9 @@ if (!fs.existsSync(src)) { } if (isWin) { - // dstWin을 PowerShell 문자열로 안전하게 escape - const dstPs = dstWin.replace(/\\/g, "\\\\"); + // PowerShell single-quote literal로 path 전달 — backslash over-escape 회피 const cmd = - `powershell -NoProfile -ExecutionPolicy Bypass -Command "$ErrorActionPreference=\\"Stop\\"; $src=\\"dist\\"; $dst=\\"${dstPs}\\"; if(!(Test-Path $src)){ throw \\"dist not found. Run build first.\\" }; if(!(Test-Path $dst)){ throw \\"NAS 경로를 찾을 수 없음: $dst — Z: 매핑 또는 NAS_FRONTEND_DEST_WIN env 확인\\" }; $log = Join-Path (Get-Location) \\"robocopy.log\\"; robocopy $src $dst /MIR /R:1 /W:1 /E /NFL /NDL /NP /V /TEE /LOG:$log; $rc = $LASTEXITCODE; if($rc -ge 8){ Write-Host \\"robocopy failed with code $rc. See $log\\"; exit $rc } else { exit 0 }"`; + `powershell -NoProfile -ExecutionPolicy Bypass -Command "$ErrorActionPreference='Stop'; $src='dist'; $dst='${dstWin}'; if(!(Test-Path $src)){ throw 'dist not found. Run build first.' }; if(!(Test-Path $dst)){ throw ('NAS 경로를 찾을 수 없음: ' + $dst + ' — Z: 매핑 또는 NAS_FRONTEND_DEST_WIN env 확인') }; $log = Join-Path (Get-Location) 'robocopy.log'; robocopy $src $dst /MIR /R:1 /W:1 /E /NFL /NDL /NP /V /TEE /LOG:$log; $rc = $LASTEXITCODE; if($rc -ge 8){ Write-Host ('robocopy failed with code ' + $rc + '. See ' + $log); exit $rc } else { exit 0 }"`; execSync(cmd, { stdio: "inherit" }); } else if (isMac) { const sshTarget = process.env.NAS_SSH_TARGET;