Skip to content

Commit

Permalink
fix: add chmod +x to dist/index.js (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusschiesser authored Mar 22, 2024
1 parent e9a6cd0 commit bf1430d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@
# build dist/index.js file
npm run clean && ncc build ./index.ts -o ./dist/ --minify --no-cache --no-source-map-register

# add shebang to the top of dist/index.js (space after shebang is to fix windows issue)
echo '#!/usr/bin/env node ' | cat - dist/index.js > temp && mv temp dist/index.js
# add shebang to the top of dist/index.js
# XXX: Windows needs a space after `node` to work correctly
# Note: ncc can handle shebang but it didn't work with Windows in our tests
echo '#!/usr/bin/env node ' | cat - dist/index.js >temp && mv temp dist/index.js

# make dist/index.js executable
chmod +x dist/index.js

0 comments on commit bf1430d

Please sign in to comment.