From ea2766f0953107506418704bc852204802cd5d0b Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 12 Jul 2024 12:29:41 +0200 Subject: [PATCH] Recommend `-S` on hashbang (#810) 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 https://github.com/privatenumber/tsx/pull/523 and https://unix.stackexchange.com/a/477651. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 72240f40c..34251eb57 100644 --- a/README.md +++ b/README.md @@ -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 ```