yarnpkg / berry

📦🐈 Active development trunk for Yarn ⚒
https://yarnpkg.com
BSD 2-Clause "Simplified" License
7.23k stars 1.07k forks source link

[Bug?]: support for -S in env shebang #6305

Open npenin opened 1 month ago

npenin commented 1 month ago

Self-service

Describe the bug

when using the -S parameter on env shebang line, the generated shim files are completely messed up

To reproduce

#!/usr/bin/env -S node --enable-source-maps
console.log('hello world')

Environment

System:
    OS: Windows 11 10.0.22631
    CPU: (32) x64 13th Gen Intel(R) Core(TM) i9-13900K
  Binaries:
    Node: 22.2.0 - ~\AppData\Local\Temp\xfs-d216ad6d\node.CMD
    Yarn: 4.1.1 - ~\AppData\Local\Temp\xfs-d216ad6d\yarn.CMD
    npm: 10.7.0 - C:\Program Files\nodejs\npm.CMD

Additional context

it is true for both generated shims on windows: shim and shim.cmd

npenin commented 1 month ago

apparently should have been covered by https://github.com/pnpm/cmd-shim/commit/218d3379c9994ce02606d2f829e921fe88336088