From 796665ceec92dce69909399c9471b3df27ca80d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Thu, 16 Apr 2026 22:51:56 -0400 Subject: [PATCH] refactor(release-local): rename hasDocker to hasDockerInstalled (P1-12) --- scripts/release-local.mjs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/release-local.mjs b/scripts/release-local.mjs index 4ee97cb5..e385a6ce 100644 --- a/scripts/release-local.mjs +++ b/scripts/release-local.mjs @@ -60,11 +60,11 @@ Environment loading: `); } -function hasDocker() { - return spawnSyncSuccess("docker", ["--version"]); +function hasDockerInstalled() { + return spawnAndAwaitExitCode("docker", ["--version"]); } -function spawnSyncSuccess(command, args) { +function spawnAndAwaitExitCode(command, args) { return new Promise((resolve) => { const child = spawn(command, args, { stdio: "ignore" }); child.on("error", () => resolve(false)); @@ -97,7 +97,7 @@ async function validatePreflight(platforms, upload) { "(APPLE_ID/APPLE_APP_SPECIFIC_PASSWORD/APPLE_TEAM_ID or APPLE_API_KEY trio).", ); } - if ((platforms.includes("win") || platforms.includes("linux")) && !(await hasDocker())) { + if ((platforms.includes("win") || platforms.includes("linux")) && !(await hasDockerInstalled())) { throw new Error("Docker is required to build Windows/Linux locally from this macOS host."); } if (!upload) {