import { mkdir, rm } from "node:fs/promises"; import path from "node:path"; import { fileURLToPath } from "node:url"; import { execFile } from "node:child_process"; import { promisify } from "node:util"; const execFileAsync = promisify(execFile); const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const projectRoot = path.resolve(__dirname, ".."); const sourceDir = path.join(projectRoot, "dist-release"); const releaseDir = path.join(projectRoot, "release"); const archivePath = path.join( releaseDir, "star-chart-search-enhancer-internal.zip" ); await mkdir(releaseDir, { recursive: true }); await rm(archivePath, { force: true }); await execFileAsync("zip", ["-X", "-r", archivePath, "."], { cwd: sourceDir }); console.log(`Internal archive created at ${archivePath}`);