From 9930852c719355f84e0a6864db9726b93f4dafa8 Mon Sep 17 00:00:00 2001 From: Xavier Drdak <1198051+xdrdak@users.noreply.github.com> Date: Thu, 28 Apr 2022 18:03:33 -0400 Subject: [PATCH 1/2] chore: small indirection to exec studio cli universally --- package.json | 1 + scripts/run-cli.js | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 scripts/run-cli.js diff --git a/package.json b/package.json index 8e3846038..1510fdc94 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "publish:npm": "pnpm publish --access public", "start": "nest start", "studio": "./studio.sh", + "studio-n": "node ./scripts/run-cli.js", "test": "jest --runInBand --forceExit", "test:integration": "jest --runInBand --forceExit --config jest.integration.config.js", "test:watch": "jest --watch" diff --git a/scripts/run-cli.js b/scripts/run-cli.js new file mode 100644 index 000000000..83592d1af --- /dev/null +++ b/scripts/run-cli.js @@ -0,0 +1,10 @@ +const { execSync } = require('child_process'); + +const isWin = process.platform === 'win32'; +const args = process.argv.slice(2).join(' '); + +if (isWin) { + execSync(`./studio.bat ${args}`, { stdio: 'inherit' }); +} else { + execSync(`./studio.sh ${args}`, { stdio: 'inherit' }); +} From 25634f0c9da3024e00d6f70ffe3a9739f9666569 Mon Sep 17 00:00:00 2001 From: Xavier Drdak <1198051+xdrdak@users.noreply.github.com> Date: Thu, 28 Apr 2022 18:07:47 -0400 Subject: [PATCH 2/2] chore: update studio npm script to target indirection file --- package.json | 3 +-- scripts/run-cli.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 1510fdc94..c9f3b83b0 100644 --- a/package.json +++ b/package.json @@ -16,8 +16,7 @@ "prepublish:npm": "pnpm build", "publish:npm": "pnpm publish --access public", "start": "nest start", - "studio": "./studio.sh", - "studio-n": "node ./scripts/run-cli.js", + "studio": "node ./scripts/run-cli.js", "test": "jest --runInBand --forceExit", "test:integration": "jest --runInBand --forceExit --config jest.integration.config.js", "test:watch": "jest --watch" diff --git a/scripts/run-cli.js b/scripts/run-cli.js index 83592d1af..02e6051ab 100644 --- a/scripts/run-cli.js +++ b/scripts/run-cli.js @@ -4,7 +4,7 @@ const isWin = process.platform === 'win32'; const args = process.argv.slice(2).join(' '); if (isWin) { - execSync(`./studio.bat ${args}`, { stdio: 'inherit' }); + execSync(`studio.bat ${args}`, { stdio: 'inherit' }); } else { execSync(`./studio.sh ${args}`, { stdio: 'inherit' }); }