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

fix shebangExpr: ignore -S argument for /usr/bin/env #94

Closed
wants to merge 1 commit into from

Conversation

milahu
Copy link

@milahu milahu commented Nov 24, 2022

fixes pnpm/pnpm#5575

related to pnpm#42

repro does not work for npm
because for this package, npm does not create a wrapper script

i guess these are only created for transitive dependencies in a deep node_modules folder
where we must set the basedir

cd $(mktemp -d)
npm init -y
npm i @suid/codemod prettier
npx @suid/codemod

npm

head -n5 node_modules/.bin/codemod 

#!/usr/bin/env -S node --no-warnings --experimental-specifier-resolution=node
import fixEsm from "./actions/fixEsm";
import mui2suid from "./actions/mui2suid";
import react2solid from "./actions/react2solid";
import suidImports from "./actions/suidImports";

pnpm

head -n5 node_modules/.bin/codemod 

#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")

case `uname` in
    *CYGWIN*) basedir=`cygpath -w "$basedir"`;;

@milahu milahu requested a review from a team as a code owner November 24, 2022 08:42
@milahu
Copy link
Author

milahu commented Nov 24, 2022

closing as duplicate of #55

@milahu milahu closed this Nov 24, 2022
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.

exec: -S: invalid option. pnpm fails to parse shebang: #!/usr/bin/env -S node
1 participant