Skip to content

fix: preserve exec bit on dist/cli.js after build - #610

Merged
Colin Francis (colifran) merged 6 commits into
langchain-ai:mainfrom
Tomaskobel:fix/postbuild-exec-bit
Aug 8, 2026
Merged

fix: preserve exec bit on dist/cli.js after build#610
Colin Francis (colifran) merged 6 commits into
langchain-ai:mainfrom
Tomaskobel:fix/postbuild-exec-bit

Conversation

@Tomaskobel

Copy link
Copy Markdown
Contributor

prebuild removes dist/, and tsc regenerates cli.js without the executable bit. For a globally linked install (npm link), the bin symlink then points at a non-executable file, so openwiki fails with permission denied after every rebuild. Contributors hit this on each edit → build → run iteration.

Adding a postbuild step restores the bit.

Before

$ pnpm run build && ls -l dist/cli.js
-rw-r--r--  dist/cli.js

After

$ pnpm run build && ls -l dist/cli.js
-rwxr-xr-x  dist/cli.js

Checks

  • pnpm run format:check — all files match Prettier
  • pnpm run lint:check — clean
  • pnpm test — 935 passed (76 files)

Note on changesets

No changeset included: this affects the local build only, not published runtime behavior, since npm sets the exec bit on bin entries at install time. Happy to add one if you'd prefer.

🤖 Generated with Claude Code

The prebuild clean removes dist/, and tsc regenerates cli.js without the
executable bit. This breaks a globally linked install (npm link), since the
bin symlink then points at a non-executable file: `openwiki` fails with
"permission denied" after every rebuild.

Add a postbuild chmod so the linked global command survives rebuilds.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Aug 7, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5296c15

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
openwiki Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@colifran Colin Francis (colifran) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Tomas Bel (@Tomaskobel)! In the future please make sure you add a changeset using pnpm changeset

@colifran
Colin Francis (colifran) merged commit c74ae1e into langchain-ai:main Aug 8, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants