Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Less quiet (print command but not stdout) #556

Closed
mnpenner opened this issue Dec 3, 2022 · 0 comments
Closed

Feature Request: Less quiet (print command but not stdout) #556

mnpenner opened this issue Dec 3, 2022 · 0 comments

Comments

@mnpenner
Copy link

mnpenner commented Dec 3, 2022

Expected Behavior

const output = (await $`hg root`.quiet({cmd:true)).stdout
// or
const output = await $`hg root`.stdoutPromise()
// or
const output = await $.stdout`...`

Will print

$ hg root

But not stdout.

That way I can see what commands are executing without cluttering my terminal with long outputs, particularly ones that I'm going to use in subsequent commands anyway.

Actually it would be nice to have .stdoutPromise() or whatever it should be called trim any trailing whitespace too.

Also, I think it can still print stderr to the terminal. It's just stdout I want to suppress when I'm capturing it anyway.

Actual Behavior

const projectDir = (await $`hg root`).stdout
console.log(projectDir)

Will print my project dir twice,

const projectDir = (await $`hg root`.quiet()).stdout
console.log(projectDir)

Will print my project dir once, like I want, but also doesn't show me the command it executed.

Steps to Reproduce the Problem

See above.

Specifications

  • Version: 7.1.1
  • Platform: Ubuntu 20.04.2 LTS (under WSL)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants