-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
We can get an exit code of single command like this.
const { stdout, code } = await $`ls -l`.noThrow().quiet()But, how can we get exit codes of piped command?
// `code` always means an exit code of `sort`
// can't retrieve an exit code of `ls -l` anymore
const { stdout, code } = await $`ls -l | sort`.noThrow().quiet()I follow my workaround now.
const { formerStdout, formerCode } = await $`ls -l`.noThrow().quiet()
const { latterStdout, latterCode } = await $`echo ${stdout} | sort`.noThrow().quiet()Metadata
Metadata
Assignees
Labels
No labels