From 3505e29e3cbdac90ce42e79155b5c390f74f1975 Mon Sep 17 00:00:00 2001 From: cdimitroulas Date: Fri, 5 Jun 2020 12:04:53 +0100 Subject: [PATCH] Modify run script so more complex flags can be passed to ts-node --- scripts/run.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/scripts/run.ts b/scripts/run.ts index e3b778b..559320c 100644 --- a/scripts/run.ts +++ b/scripts/run.ts @@ -1,16 +1,11 @@ -import path from "path"; import spawn from "cross-spawn"; -import { appDirectory } from "./utils"; - const args = process.argv.slice(3); function run(): number { - const result = spawn.sync( - path.join(appDirectory, "./node_modules/.bin/ts-node"), - args, - { stdio: "inherit" } - ); + const result = spawn.sync("node", ["-r", "ts-node/register", ...args], { + stdio: "inherit" + }); if (result.error) { console.error(result.error);