Skip to content

Commit

Permalink
fix(dlx): print install output to stderr (#4696)
Browse files Browse the repository at this point in the history
close #1698
  • Loading branch information
zkochan committed May 7, 2022
1 parent f429d96 commit 23a66ba
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/six-llamas-design.md
@@ -0,0 +1,5 @@
---
"pnpm": patch
---

`pnpm dlx` should print messages about installation to stderr [#1698](https://github.com/pnpm/pnpm/issues/1698).
3 changes: 3 additions & 0 deletions packages/pnpm/src/main.ts
Expand Up @@ -98,6 +98,9 @@ export default async function run (inputArgv: string[]) {
workspaceDir,
checkUnknownSetting: false,
}) as typeof config
if (cmd === 'dlx') {
config.useStderr = true
}
config.forceSharedLockfile = typeof config.workspaceDir === 'string' && config.sharedWorkspaceLockfile === true
config.argv = argv
config.fallbackCommandUsed = fallbackCommandUsed
Expand Down
2 changes: 1 addition & 1 deletion packages/pnpm/test/cli.ts
Expand Up @@ -126,7 +126,7 @@ test('pnpx works', () => {

const result = execPnpxSync(['--yes', 'hello-world-js-bin'])

expect(result.stdout.toString()).toMatch(/Hello world!/)
expect(result.stdout.toString()).toEqual('Hello world!\n')
expect(result.status).toBe(0)
})

Expand Down

0 comments on commit 23a66ba

Please sign in to comment.