From bd8b4dd425429b1c430c9ffb82e4dffa240fa026 Mon Sep 17 00:00:00 2001 From: gahusb Date: Sun, 25 Jan 2026 22:13:51 +0900 Subject: [PATCH] =?UTF-8?q?deploy:nas=20macOS=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/deploy-nas.cjs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/deploy-nas.cjs b/scripts/deploy-nas.cjs index 830d329..74882d6 100644 --- a/scripts/deploy-nas.cjs +++ b/scripts/deploy-nas.cjs @@ -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" }); }