Skip to content

Commit

Permalink
feat: expose formatted cmd via getter (#891)
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub authored Sep 14, 2024
1 parent ae4fb3c commit 5d78a26
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,10 @@ export class ProcessPromise extends Promise<ProcessOutput> {
return this
}

get cmd() {
return this._command
}

get child() {
return this._zurk?.child
}
Expand Down
7 changes: 7 additions & 0 deletions test/core.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,13 @@ describe('core', () => {
assert.ok(o instanceof ProcessOutput)
})

test('cmd() returns cmd to exec', () => {
const foo = '#bar'
const baz = 1
const p = $`echo ${foo} --t ${baz}`
assert.equal(p.cmd, "echo $'#bar' --t 1")
})

test('stdio() works', async () => {
let p = $`printf foo`
await p
Expand Down

0 comments on commit 5d78a26

Please sign in to comment.