Skip to content

Commit

Permalink
fix: handling the error output of the npm diff command
Browse files Browse the repository at this point in the history
  • Loading branch information
jzhangdev committed Apr 3, 2024
1 parent 5b901f6 commit 7b8bb06
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix: handling the error output of the npm diff command",
"packageName": "@rightcapital/verdaccio-package-diff",
"email": "[email protected]",
"dependentChangeType": "patch"
}
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ export default class VerdaccioMiddlewarePlugin
{ signal },
);

if (npmDiff.error) {
textTypeResponse(req, res, next)(npmDiff.error.toString());
if (npmDiff.status !== 0) {
textTypeResponse(req, res, next)(npmDiff.stderr.toString());
} else {
textTypeResponse(req, res, next)(npmDiff.output.toString());
textTypeResponse(req, res, next)(npmDiff.stdout.toString());
}
}
},
Expand Down

0 comments on commit 7b8bb06

Please sign in to comment.