From 8627ec1faba53644b366c314be248e1bba48f329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Fri, 5 Aug 2022 10:14:46 +0200 Subject: [PATCH] Attempt to log when publish fails if is empty and JSON error can't be retrieved from none of those (#844) --- .changeset/silver-toys-turn.md | 5 +++++ packages/cli/src/commands/publish/npm-utils.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/silver-toys-turn.md diff --git a/.changeset/silver-toys-turn.md b/.changeset/silver-toys-turn.md new file mode 100644 index 000000000..941025b6f --- /dev/null +++ b/.changeset/silver-toys-turn.md @@ -0,0 +1,5 @@ +--- +"@changesets/cli": patch +--- + +Attempt to log `stdout` when publish fails if `stderr` is empty and JSON error can't be retrieved from none of those. diff --git a/packages/cli/src/commands/publish/npm-utils.ts b/packages/cli/src/commands/publish/npm-utils.ts index df10e8d7c..d72805ea2 100644 --- a/packages/cli/src/commands/publish/npm-utils.ts +++ b/packages/cli/src/commands/publish/npm-utils.ts @@ -214,7 +214,7 @@ async function internalPublish( ); } - error(stderr.toString()); + error(stderr.toString() || stdout.toString()); return { published: false }; } return { published: true };