#!/usr/bin/env node
import { readFileSync, writeFileSync, chmodSync } from "fs";
import { fileURLToPath } from "url";
import { dirname, join } from "path";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const distFile = join(__dirname, "..", "dist", "index.js");
const content = readFileSync(distFile, "utf-8");
// Add shebang if not present
if (!content.startsWith("#!/usr/bin/env node")) {
writeFileSync(distFile, "#!/usr/bin/env node\n" + content);
console.log("Added shebang to dist/index.js");
}
// Make the file executable (755 permissions: rwxr-xr-x)
chmodSync(distFile, 0o755);
console.log("Made dist/index.js executable");