Skip to content

Fix wrong default subpath for string bin values#345

Open
prjanitor wants to merge 1 commit intoComandeer:mainfrom
prjanitor:prjanitor/16ee0cd59c1603d49a4c1ecf91af14313449f1d4
Open

Fix wrong default subpath for string bin values#345
prjanitor wants to merge 1 commit intoComandeer:mainfrom
prjanitor:prjanitor/16ee0cd59c1603d49a4c1ecf91af14313449f1d4

Conversation

@prjanitor
Copy link
Copy Markdown

Bug Description

When package.json has a string bin value (e.g., "bin": "./cli.js"), the code incorrectly used the package name instead of the bin string itself to construct the subpath. This caused the wrong file path to be used for the binary entry point.

Fix

Changed line 73 in src/packageParser/prepareDistMetadata.ts from:

`./__bin__/${ name }`

to:

`./__bin__/${ bin }`

This ensures that when bin is a string, the subpath is constructed from the actual bin path value, consistent with how the object case works where each key in the bin object is used to construct the subpath.


This PR was generated by PRJanitor — an automated tool that finds and fixes small bugs in open-source projects.

We respect your contribution guidelines — if your project doesn't accept bot PRs, we won't send more. You can also add a .github/prjanitor.yml file with enabled: false to opt out explicitly.

When package.json has a string bin value, the code was incorrectly using the package name instead of the bin string itself to construct the subpath. This caused the wrong file path to be used for the binary entry point.

Changed `./__bin__/${ name }` to `./__bin__/${ bin }` in the getBinSubPaths function.
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.

1 participant