diff --git a/compiler/build.js b/compiler/build.js new file mode 100644 index 0000000..277d9a7 --- /dev/null +++ b/compiler/build.js @@ -0,0 +1,10 @@ +#!/usr/bin/env node +const { execSync } = require("child_process"); +const fs = require("fs"); + +execSync("tsc", { stdio: "inherit" }); + +const cliPath = "dist/cli.js"; +const content = fs.readFileSync(cliPath, "utf-8"); +fs.writeFileSync(cliPath, "#!/usr/bin/env node\n" + content); +console.log("v Added shebang to " + cliPath); diff --git a/compiler/package.json b/compiler/package.json index 1a24fa2..42b4bbe 100644 --- a/compiler/package.json +++ b/compiler/package.json @@ -16,7 +16,7 @@ "README.md" ], "scripts": { - "build": "tsc", + "build": "node build.js", "prepare": "npm run build", "prepublishOnly": "npm run build", "start": "ts-node src/cli.ts",