Skip to content

Commit

Permalink
Recommend -S on hashbang
Browse files Browse the repository at this point in the history
The previous hashbang did not work on Linux coreutils `env` because `env` passes the arguments as single string to `node`. By adding `-S` we can make it split the arguments and this works on both Linux with coreutils >= 8.30 and Mac.

Also see privatenumber/tsx#523 and https://unix.stackexchange.com/a/477651.
  • Loading branch information
silverwind authored Jul 11, 2024
1 parent efedb38 commit 0baa217
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ SWCRC=true node -r @swc-node/register script.ts
```

```typescript
#!/usr/bin/env node --import @swc-node/register/esm-register
#!/usr/bin/env -S node --import @swc-node/register/esm-register

// your code
```
Expand Down

0 comments on commit 0baa217

Please sign in to comment.