Skip to content

Commit 4cd8628

Browse files
committed
Fix banner for the bin.
1 parent 5285b78 commit 4cd8628

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

script/build.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { build } from "esbuild";
22
import { readFileSync } from "fs";
3+
import { chmod } from "fs/promises";
34

45
build({
56
entryPoints: ["src/webauthn-json/index.ts"],
@@ -40,12 +41,14 @@ build({
4041
const { version } = JSON.parse(
4142
readFileSync(new URL("../package.json", import.meta.url)),
4243
);
43-
build({
44+
await build({
4445
entryPoints: ["src/bin/main.ts"],
4546
format: "esm",
4647
target: "es2020",
4748
bundle: true,
4849
sourcemap: true,
4950
define: { WEBAUTHN_JSON_VERSION: JSON.stringify(version) },
51+
banner: { js: "#!/usr/bin/env node" },
5052
outfile: "dist/bin/main.js",
5153
});
54+
chmod("dist/bin/main.js", 0o755);

0 commit comments

Comments
 (0)