-
-
Notifications
You must be signed in to change notification settings - Fork 532
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
Passing arguments in shebang on Linux (env -S) #1545
Conversation
This has come up a few times before. You can search for those discussions,
PRs, or issues. We talked about how this is only possible on certain
versions of env, so a docs change will need to mention that.
I'm on mobile and haven't been able to read this PR, so it might already
mention these things. But just saying right away that it will be important
to talk about the Linux version requirements.
…On Wed, Nov 17, 2021, 8:35 AM strupo ***@***.***> wrote:
It is possible to pass arguments into commands in the shebang (at least on
GNU/Linux) using the -S option for env [0][1].
The README currently says that it's not possible to do this on Linux,
which is wrong.
[0] env(1) manpage in Debian Bullseye
<https://manpages.debian.org/bullseye/coreutils/env.1.en.html#S>.
[1] GNU coreutils env documentation
<https://www.gnu.org/software/coreutils/manual/html_node/env-invocation.html>
.
------------------------------
You can view, comment on, or merge this pull request online at:
#1545
Commit Summary
- f3bced1
<f3bced1>
Passing arguments in shebang on Linux (env -S)
File Changes
(1 file <https://github.com/TypeStrong/ts-node/pull/1545/files>)
- *M* README.md
<https://github.com/TypeStrong/ts-node/pull/1545/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5>
(12)
Patch Links:
- https://github.com/TypeStrong/ts-node/pull/1545.patch
- https://github.com/TypeStrong/ts-node/pull/1545.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1545>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC35ODFLUNAAK5APXKJCQ3UMOVRTANCNFSM5IG7G2OQ>
.
|
@sheeit which version of |
Another thought: does Mac support |
We may consider also mentioning |
Codecov Report
|
* Note `skip-ignore` for "Skipping `node_modules`" (#1553) * Note `skip-ignore` for "Skipping `node_modules`" * Remove spurious duplication * update * revert changes to readme; readme is built from docs/ * more wordsmithing * more tweaks Co-authored-by: Andrew Bradley <[email protected]> * Passing arguments in shebang on Linux (env -S) (#1545) * Passing arguments in shebang on Linux (env -S) It is possible to pass arguments into commands in the shebang on Linux using the env(1) -S option. * fix * fix * fix Co-authored-by: Andrew Bradley <[email protected]> * link from readme logo to website (#1604) Co-authored-by: webstrand <[email protected]> Co-authored-by: wmb <[email protected]>
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [ts-node](https://typestrong.org/ts-node) ([source](https://github.com/TypeStrong/ts-node)) | devDependencies | minor | [`10.4.0` -> `10.5.0`](https://renovatebot.com/diffs/npm/ts-node/10.4.0/10.5.0) | --- ### Release Notes <details> <summary>TypeStrong/ts-node</summary> ### [`v10.5.0`](https://github.com/TypeStrong/ts-node/releases/v10.5.0) [Compare Source](TypeStrong/ts-node@v10.4.0...v10.5.0) <!-- I don't make a discussion thread for every release. Github has a button to make a discussion thread for a release. Then I update the discussion thread to remove the release notes and instead link to the release. --> Questions about this release? Ask in the official discussion thread: [#​1634](TypeStrong/ts-node#1634) **Added** - Eliminate "Emit Skipped" errors ([#​693](TypeStrong/ts-node#693), [#​1345](TypeStrong/ts-node#1345), [#​1629](TypeStrong/ts-node#1629)) - Avoids all "Emit Skipped" errors by performing a fallback `transpileOnly`-style transformation. - Does not affect typechecking. Type errors are still detected and thrown. - Fallback has the same limitations as `isolatedModules`. This will only affect rare cases such as using `const enums` with `preserveConstEnums` disabled. - Fixes [#​693](TypeStrong/ts-node#693) - Graduate swc transpiler out of experimental; add `swc: true` convenience option ([docs](https://typestrong.org/ts-node/docs/transpilers)) ([#​1487](TypeStrong/ts-node#1487), [#​1536](TypeStrong/ts-node#1536), [#​1613](TypeStrong/ts-node#1613), [#​1627](TypeStrong/ts-node#1627)) - `"swc": true` or `--swc` will use swc for faster execution - This feature is no longer marked "experimental." Thank you to everyone who filed bugs! - swc transpiler attempts to load `@swc/core` or `@swc/wasm` dependencies from your project before falling-back to global installations ([#​1613](TypeStrong/ts-node#1613), [#​1627](TypeStrong/ts-node#1627)) - global fallback only occurs when using a global installation of ts-node - Add support for TypeScript's `traceResolution` output ([docs](https://www.typescriptlang.org/tsconfig/#traceResolution)) ([#​1128](TypeStrong/ts-node#1128), [#​1491](TypeStrong/ts-node#1491)) [@​TheUnlocked](https://github.com/TheUnlocked) - Support import assertions in ESM loader ([docs](https://nodejs.org/dist/latest-v17.x/docs/api/esm.html#import-assertions)) ([#​1557](TypeStrong/ts-node#1557), [#​1558](TypeStrong/ts-node#1558), [#​1559](TypeStrong/ts-node#1559), [#​1573](TypeStrong/ts-node#1573)) [@​Pokute](https://github.com/Pokute), [@​geigerzaehler](https://github.com/geigerzaehler) - Allows importing JSON files from ESM with the requisite flag ([docs](https://nodejs.org/dist/latest-v17.x/docs/api/esm.html#json-modules)) - `ts-node -vvv` also logs absolute paths to `ts-node` and `typescript`, to make it more obvious when you're accidentally using globally-installed versions ([#​1323](TypeStrong/ts-node#1323), [#​1620](TypeStrong/ts-node#1620)) - Add swc target "es2022" ([#​1535](TypeStrong/ts-node#1535), [#​1540](TypeStrong/ts-node#1540)) - When you have target es2022 in tsconfig, will use swc's es2022 target **Changed** - Initialize TypeScript compiler before starting REPL prompt ([#​1498](TypeStrong/ts-node#1498)) [@​TheUnlocked](https://github.com/TheUnlocked) - Improves responsiveness for first line of REPL input - Use `v8-compile-cache-lib` to load typescript - improves startup time ([#​1339](TypeStrong/ts-node#1339), [#​1603](TypeStrong/ts-node#1603)) - Support both `--camelCase` and `--hyphen-case` for all CLI flags; update documentation to use `--camelCase` ([#​1598](TypeStrong/ts-node#1598), [#​1599](TypeStrong/ts-node#1599)) - Not a breaking change; CLI continues to accept both forms - Make `TSError` `diagnosticText` property non-enumerable to prevent it from being logged below the stack ([#​1632](TypeStrong/ts-node#1632)) **Fixed** - Fix [#​1538](TypeStrong/ts-node#1538): REPL inputs fail to transpile via swc ([#​1538](TypeStrong/ts-node#1538), [#​1541](TypeStrong/ts-node#1541), [#​1602](TypeStrong/ts-node#1602)) - Fix [#​1478](TypeStrong/ts-node#1478): REPL erroneously logged `undefined` for all inputs after the first when using swc transpiler ([#​1478](TypeStrong/ts-node#1478), [#​1580](TypeStrong/ts-node#1580), [#​1602](TypeStrong/ts-node#1602)) - Fix [#​1389](TypeStrong/ts-node#1389): In `--showConfig` output, emit accurate `moduleTypes` paths resolved relative to the `tsconfig.json` which declared them ([#​1389](TypeStrong/ts-node#1389), [#​1619](TypeStrong/ts-node#1619)) - Fix: Remove indentation from `ts-node --help` output ([#​1597](TypeStrong/ts-node#1597), [#​1600](TypeStrong/ts-node#1600)) - Fix [#​1425](TypeStrong/ts-node#1425): Merged definitions correctly into `tsconfig.schemastore-schema.json` ([#​1425](TypeStrong/ts-node#1425), [#​1618](TypeStrong/ts-node#1618)) - Fix: Allow disabling `"use strict"` emit in SWC transpiler ([#​1531](TypeStrong/ts-node#1531), [#​1537](TypeStrong/ts-node#1537)) - Fix: Add missing `ERR_UNKNOWN_FILE_EXTENSION` constructor; was throwing `ERR_UNKNOWN_FILE_EXTENSION is not a constructor` ([#​1562](TypeStrong/ts-node#1562)) [@​bluelovers](https://github.com/bluelovers) - Fix [#​1565](TypeStrong/ts-node#1565): entrypoint resolution failed on node v12.0.x and v12.1.x ([#​1565](TypeStrong/ts-node#1565), [#​1566](TypeStrong/ts-node#1566)) [@​davidmurdoch](https://github.com/davidmurdoch) #### Docs - Explain `env -S` flag for shebangs ([docs](https://typestrong.org/ts-node/docs/usage#shebang)) ([#​1448](TypeStrong/ts-node#1448), [#​1545](TypeStrong/ts-node#1545)) [@​sheeit](https://github.com/sheeit), [@​chee](https://github.com/chee) - Suggest `skipIgnore` when you want to compile files in node_modules ([docs](https://typestrong.org/ts-node/docs/how-it-works)) ([#​1553](TypeStrong/ts-node#1553)) [@​webstrand](https://github.com/webstrand) - Fix typo in `moduleTypes` on options page ([docs](https://typestrong.org/ts-node/docs/options)) ([#​1630](TypeStrong/ts-node#1630), [#​1633](TypeStrong/ts-node#1633)) #### Misc - Adds experimental `experimentalResolverFeatures` option, but it does not do anything yet ([#​1514](TypeStrong/ts-node#1514), [#​1614](TypeStrong/ts-node#1614)) https://github.com/TypeStrong/ts-node/milestone/4 </details> --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Co-authored-by: cabr2-bot <[email protected]> Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1156 Reviewed-by: crapStone <[email protected]> Co-authored-by: Calciumdibromid Bot <[email protected]> Co-committed-by: Calciumdibromid Bot <[email protected]>
EDIT from @cspotcode: Closes #1448, also give credit to @chee in release notes
It is possible to pass arguments into commands in the shebang (at least on GNU/Linux) using the
-S
option for env [0][1].The README currently says that it's not possible to do this on Linux, which is wrong.
[0] env(1) manpage in Debian Bullseye.
[1] GNU coreutils env documentation.