deploy:nas macOS에서 오류 수정

This commit is contained in:
2026-01-25 22:13:51 +09:00
parent dcd2910cea
commit bd8b4dd425

View File

@@ -2,6 +2,7 @@ const { execSync } = require("child_process");
const fs = require("fs");
const isWin = process.platform === "win32";
const isMac = process.platform === "darwin";
const src = "dist";
const dstWin = "Z:\\docker\\webpage\\frontend\\";
const dstMac = "/Volumes/gahusb.synology.me/docker/webpage/frontend/";
@@ -21,7 +22,15 @@ if (isWin) {
'powershell -NoProfile -ExecutionPolicy Bypass -Command "$ErrorActionPreference=\\"Stop\\"; $src=\\"dist\\"; $dst=\\"Z:\\\\docker\\\\webpage\\\\frontend\\\\\\"; if(!(Test-Path $src)){ throw \\"dist not found. Run build first.\\" }; if(!(Test-Path $dst)){ throw \\"NAS drive not found. Check Z: mapping.\\" }; $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 {
execSync(`rsync -av --delete --delete-delay --inplace ${src}/ ${dst}`, {
stdio: "inherit",
});
const baseArgs = ["rsync", "-r", "--delete", "--delete-delay"];
const macSafeArgs = [
"--omit-dir-times",
"--no-perms",
"--no-owner",
"--no-group",
"--no-times",
];
const args = isMac ? baseArgs.concat(macSafeArgs) : baseArgs.concat(["-t"]);
const cmd = `${args.join(" ")} ${src}/ ${dst}`;
execSync(cmd, { stdio: "inherit" });
}