From b15f9e60a040e2e450e7ca9971a5fc07dbf8b94c Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 22 Feb 2023 22:45:35 -0500 Subject: feat(task): support scripts in package.json (#17887) This is a super basic initial implementation. We don't create a `node_modules/.bin` folder at the moment and add it to the PATH like we should which is necessary to make command name resolution in the subprocess work properly (ex. you run a script that launches another script that then tries to launch an "npx command"... this won't work atm). Closes #17492 --- cli/tests/testdata/task/npx/non_existent.out | 2 ++ cli/tests/testdata/task/npx/on_own.out | 2 ++ cli/tests/testdata/task/npx/package.json | 6 ++++++ 3 files changed, 10 insertions(+) create mode 100644 cli/tests/testdata/task/npx/non_existent.out create mode 100644 cli/tests/testdata/task/npx/on_own.out create mode 100644 cli/tests/testdata/task/npx/package.json (limited to 'cli/tests/testdata/task/npx') diff --git a/cli/tests/testdata/task/npx/non_existent.out b/cli/tests/testdata/task/npx/non_existent.out new file mode 100644 index 000000000..5df04917e --- /dev/null +++ b/cli/tests/testdata/task/npx/non_existent.out @@ -0,0 +1,2 @@ +Task non-existent npx this-command-should-not-exist-for-you +npx: could not resolve command 'this-command-should-not-exist-for-you' diff --git a/cli/tests/testdata/task/npx/on_own.out b/cli/tests/testdata/task/npx/on_own.out new file mode 100644 index 000000000..67491f7b0 --- /dev/null +++ b/cli/tests/testdata/task/npx/on_own.out @@ -0,0 +1,2 @@ +Task on-own npx +npx: missing command diff --git a/cli/tests/testdata/task/npx/package.json b/cli/tests/testdata/task/npx/package.json new file mode 100644 index 000000000..59602b96f --- /dev/null +++ b/cli/tests/testdata/task/npx/package.json @@ -0,0 +1,6 @@ +{ + "scripts": { + "non-existent": "npx this-command-should-not-exist-for-you", + "on-own": "npx" + } +} -- cgit v1.2.3