Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions cli/scripts/make-executable.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { promises as fs } from "fs";
import { platform } from "os";
import { execSync } from "child_process";
import { spawnSync } from "child_process";
import path from "path";

const TARGET_FILE = path.resolve("build/cli.js");
Expand All @@ -12,7 +12,10 @@ async function makeExecutable() {
try {
// On Unix-like systems (Linux, macOS), use chmod
if (platform() !== "win32") {
execSync(`chmod +x "${TARGET_FILE}"`);
const r = spawnSync("chmod", ["+x", TARGET_FILE], { stdio: "inherit" });
if (r.error) throw r.error;
if (r.status !== 0)
throw new Error(`chmod failed with exit code ${r.status}`);
console.log("Made file executable with chmod");
} else {
// On Windows, no need to make files "executable" in the Unix sense
Expand Down
8 changes: 6 additions & 2 deletions scripts/update-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import fs from "fs";
import path from "path";
import { execSync } from "child_process";
import { spawnSync } from "child_process";
import { fileURLToPath } from "url";

const __filename = fileURLToPath(import.meta.url);
Expand Down Expand Up @@ -84,7 +84,11 @@ console.log(`Updated ${updatedFiles.length} files to version ${newVersion}`);
// Update package-lock.json
console.log("\n🔒 Updating package-lock.json...");
try {
execSync("npm install", { stdio: "inherit" });
const npmCmd = process.platform === "win32" ? "npm.cmd" : "npm";
const r = spawnSync(npmCmd, ["install"], { stdio: "inherit" });
if (r.error) throw r.error;
if (r.status !== 0)
throw new Error(`npm install failed with exit code ${r.status}`);
console.log("✅ package-lock.json updated successfully");
} catch (error) {
console.error("❌ Failed to update package-lock.json:", error.message);
Expand Down