Skip to content

Commit 3f8ebd1

Browse files
fix: include postinstall script in package and add restart hint (#16)
The postinstall script was missing from the `files` array so npm never included it in the published tarball -- the `|| true` silenced the error. Add `scripts/postinstall.js` to `files`. Also tell users to restart their terminal after installing Bun, since the installer only updates shell config files and the current session won't pick up the new PATH entry. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent d07b4a5 commit 3f8ebd1

4 files changed

Lines changed: 5 additions & 3 deletions

File tree

bin/cli.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ try {
2424
console.error(
2525
"talent-agent requires the Bun runtime.\n\n" +
2626
" Install it: curl -fsSL https://bun.sh/install | bash\n" +
27-
" Learn more: https://bun.sh\n",
27+
" Then restart your terminal (or run: source ~/.bashrc)\n",
2828
);
2929
process.exit(1);
3030
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"files": [
1010
"src",
1111
"skills",
12-
"bin"
12+
"bin",
13+
"scripts/postinstall.js"
1314
],
1415
"exports": {
1516
".": "./src/lib.ts",

scripts/postinstall.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ console.log("");
2626
if (!hasBun) {
2727
console.log(" Bun runtime is required but was not found.");
2828
console.log(" Install it: curl -fsSL https://bun.sh/install | bash");
29-
console.log(" Learn more: https://bun.sh");
29+
console.log(" Then restart your terminal (or run: source ~/.bashrc)");
3030
console.log("");
3131
}
3232

test/postinstall.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,6 @@ describe("scripts/postinstall.js", () => {
8383

8484
expect(stdout).toContain("Bun runtime is required but was not found");
8585
expect(stdout).toContain("curl -fsSL https://bun.sh/install | bash");
86+
expect(stdout).toContain("restart your terminal");
8687
});
8788
});

0 commit comments

Comments
 (0)