From 3b6c1206f87127baedef8fe200eccbd658830d4a Mon Sep 17 00:00:00 2001 From: Anton Golub Date: Mon, 11 Nov 2024 01:46:41 +0300 Subject: [PATCH] fix: handle nullable stdout/stderr (#943) closes #942 --- package-lock.json | 22 +++++++++++----------- package.json | 8 ++++---- test/core.test.js | 4 +++- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 926b0c0207..c311066b75 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "zx", - "version": "8.2.1", + "version": "8.2.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "zx", - "version": "8.2.1", + "version": "8.2.2", "license": "Apache-2.0", "bin": { "zx": "build/cli.js" @@ -18,7 +18,7 @@ "@types/node": ">=20.11.30", "@types/which": "^3.0.4", "@webpod/ingrid": "^0.0.0-beta.3", - "@webpod/ps": "^0.0.0-beta.10", + "@webpod/ps": "^0.0.0-beta.11", "c8": "^10.1.2", "chalk": "^5.3.0", "create-require": "^1.1.1", @@ -45,7 +45,7 @@ "typescript": "^5.6.3", "which": "^5.0.0", "yaml": "^2.5.1", - "zurk": "^0.6.0" + "zurk": "^0.6.2" }, "engines": { "node": ">= 12.17.0" @@ -1264,14 +1264,14 @@ "license": "MIT" }, "node_modules/@webpod/ps": { - "version": "0.0.0-beta.10", - "resolved": "https://registry.npmjs.org/@webpod/ps/-/ps-0.0.0-beta.10.tgz", - "integrity": "sha512-Y+lfZ+xxj08NaVajl5fLIVIB6ddMn0ldpzhhlgpGpOUM1YEtSshtsqwxqGW2jIbGcH+IrbVJFUzS73oQleRttw==", + "version": "0.0.0-beta.11", + "resolved": "https://registry.npmjs.org/@webpod/ps/-/ps-0.0.0-beta.11.tgz", + "integrity": "sha512-oW4oObIu4UfWzPp2tFaafJbJVBsJtxcIRE0Jx4CpwsmhyAU91/6n9Yz5HlhagBiktvIWPcwe5t0PNPinVdG1oA==", "dev": true, "license": "MIT", "dependencies": { "@webpod/ingrid": "^0.0.0-beta.3", - "zurk": "^0.6.0" + "zurk": "^0.6.2" } }, "node_modules/acorn": { @@ -5930,9 +5930,9 @@ } }, "node_modules/zurk": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/zurk/-/zurk-0.6.0.tgz", - "integrity": "sha512-7ecsvna80gz1Mnrx5xqf5ay1a6T9h0VwZg5rzPnhX4YTBM4ZiofMlftAFYJ9vcVaIYl2CPBjEvNGTtG6d/ivGQ==", + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/zurk/-/zurk-0.6.2.tgz", + "integrity": "sha512-YRcg47pQv+2NaJoc85wCwk07i6H0YYUbKv0cbqWkYg1BxVlWhL9YOOoXVQLWSO5m1MKpFKGp/hfsmTo8/diPug==", "dev": true, "license": "MIT" } diff --git a/package.json b/package.json index b025832979..d03d30add3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zx", - "version": "8.2.1", + "version": "8.2.2", "description": "A tool for writing better scripts", "type": "module", "main": "./build/index.cjs", @@ -80,7 +80,7 @@ "test:smoke:tsx": "tsx test/smoke/ts.test.ts", "test:smoke:tsc": "cd test/smoke && mkdir -p node_modules && ln -s ../../../ ./node_modules/zx; ../../node_modules/typescript/bin/tsc -v && ../../node_modules/typescript/bin/tsc --esModuleInterop --module node16 --rootDir . --outdir ./temp ts.test.ts && node ./temp/ts.test.js", "test:smoke:ts-node": "node --loader ts-node/esm test/smoke/ts.test.ts", - "test:smoke:bun": "bun test ./test/smoke/bun.test.js", + "test:smoke:bun": "bun test ./test/smoke/bun.test.js && bun ./test/smoke/node.test.mjs", "test:smoke:win32": "node ./test/smoke/win32.test.js", "test:smoke:cjs": "node ./test/smoke/node.test.cjs", "test:smoke:mjs": "node ./test/smoke/node.test.mjs", @@ -97,7 +97,7 @@ "@types/node": ">=20.11.30", "@types/which": "^3.0.4", "@webpod/ingrid": "^0.0.0-beta.3", - "@webpod/ps": "^0.0.0-beta.10", + "@webpod/ps": "^0.0.0-beta.11", "c8": "^10.1.2", "chalk": "^5.3.0", "create-require": "^1.1.1", @@ -124,7 +124,7 @@ "typescript": "^5.6.3", "which": "^5.0.0", "yaml": "^2.5.1", - "zurk": "^0.6.0" + "zurk": "^0.6.2" }, "publishConfig": { "registry": "https://wombat-dressing-room.appspot.com" diff --git a/test/core.test.js b/test/core.test.js index f2672b7629..62aea0588c 100644 --- a/test/core.test.js +++ b/test/core.test.js @@ -274,7 +274,9 @@ describe('core', () => { }) test('inherit', async () => { - await $({ stdio: 'inherit' })`ls` + const r1 = (await $({ stdio: 'inherit' })`ls`).stdout + const r2 = $.sync({ stdio: 'inherit' })`ls`.stdout + assert.equal(r1, r2) }) test('file stream as stdout', async () => {