Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cspotcode committed Jan 21, 2022
1 parent 2804165 commit 9e77014
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,17 +162,11 @@ console.log("Hello, world!")
```

Passing CLI arguments via shebang is allowed on Mac but not Linux. For example, the following will fail on Linux:
### Passing CLI arguments via shebang

- On Mac:
#!/usr/bin/env ts-node --files
// This shebang is not portable. It only works on Mac

#!/usr/bin/env ts-node --files

- On Linux:

#!/usr/bin/env -S ts-node --files

The `-S` option for `env` processes and splits what comes after it into separate arguments; and is used to pass multiple arguments on shebang lines.
Instead, specify all ts-node options in your `tsconfig.json`.

## Programmatic

Expand Down

0 comments on commit 9e77014

Please sign in to comment.