Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: prepend shebang plugin #504

Merged
merged 13 commits into from
Apr 1, 2024
Merged

feat: prepend shebang plugin #504

merged 13 commits into from
Apr 1, 2024

Conversation

hyoban
Copy link
Contributor

@hyoban hyoban commented Mar 29, 2024

close #415

credit: https://github.com/privatenumber/pkgroll/blob/bbb87f6410668e4c99af768ec0d2b021f8375824/src/utils/rollup-plugins/patch-binary.ts

  1. If there is no shebang line for bin entry, #!/usr/bin/env node\n will be prepended automatically.
  2. If the bin entry already started with a shebang line, the code will not be changed

@hyoban hyoban changed the title feat: patch binary directive feat: patch binary plugin Mar 29, 2024
commit 3ca6cbd
Author: Jiachi Liu <inbox@huozhi.im>
Date:   Fri Mar 29 14:28:15 2024 +0100

    5.0.1

commit c8ae157
Author: Jiachi Liu <inbox@huozhi.im>
Date:   Fri Mar 29 14:27:42 2024 +0100

    Fix missing nested exports (#503)
@hyoban hyoban marked this pull request as draft March 29, 2024 15:22
@hyoban hyoban marked this pull request as ready for review March 29, 2024 15:26
src/plugins/patch-binary.ts Outdated Show resolved Hide resolved
src/plugins/patch-binary.ts Outdated Show resolved Hide resolved
src/build-config.ts Outdated Show resolved Hide resolved
src/plugins/patch-binary.ts Outdated Show resolved Hide resolved
@hyoban hyoban changed the title feat: patch binary plugin feat: prepend shebang plugin Mar 31, 2024
@hyoban hyoban requested a review from huozhi March 31, 2024 16:00
src/build-config.ts Outdated Show resolved Hide resolved
@hyoban hyoban requested a review from huozhi April 1, 2024 09:27
Copy link
Owner

@huozhi huozhi left a comment

Choose a reason for hiding this comment

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

Thanks! Nice work!

@huozhi huozhi merged commit 1979a5a into huozhi:main Apr 1, 2024
3 checks passed
@hyoban
Copy link
Contributor Author

hyoban commented Apr 1, 2024

Thanks to your nice reviews too

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.

Automatically add #!/usr/bin/env node to output bundle of binaries
2 participants