Skip to content

Conversation

tiennou
Copy link

@tiennou tiennou commented Feb 7, 2025

This ensures the dist/clientApp.js script is properly marked as +x, which fixes an issue with npx failing to execute it.

@tiennou tiennou changed the title Fix exec script fix: make generated script executable Feb 7, 2025
nodeResolve(),
typescript({ tsconfig: './tsconfig.json' })
typescript({ tsconfig: './tsconfig.json' }),
shebang({ include: "src/clientApp.ts" }),
Copy link
Member

@admon84 admon84 Feb 8, 2025

Choose a reason for hiding this comment

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

I wonder if this can be done with a banner in the output section instead of adding the shebang plugin

banner: '#!/usr/bin/env node'

Copy link
Author

@tiennou tiennou Feb 11, 2025

Choose a reason for hiding this comment

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

It's not only about the banner, we need a chmod +x to happen to the output, otherwise you get a EPERM error when trying to exec that on a *nix platform. Like, node ./clientApp.js would work (since the thing being exec'd is node, which has its +x bit set), but ./clientApp.js wouldn't.

@admon84 admon84 merged commit d04514a into screepers:main Feb 11, 2025
3 of 4 checks passed
@tiennou tiennou deleted the fix-exec-script branch February 11, 2025 18:26
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