Skip to content

Commit

Permalink
feat: set default $.cwd
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Jul 3, 2022
1 parent 1c82ac7 commit 5b464ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/js/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ $.raw = async (...args) => $.o({quote: v => v})(...args)
// https://github.com/google/zx/pull/134
$.silent = async (...args) => quiet($(...args))

// https://github.com/google/zx/blob/c73ccb468cfd2340fb296e17a543eb2399b449ec/src/core.ts#L174
$.cwd = process.cwd()

$.o = $.opt =
(opts) =>
(...args) =>
Expand Down
5 changes: 5 additions & 0 deletions src/test/js/test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,8 @@ import {$, semver, createHook, ip, tempy, tcping, sleep, ctx} from '../../main/j
$.verbose = 2
})
}

// $.cwd
{
assert.ok($.cwd === process.cwd())
}

0 comments on commit 5b464ce

Please sign in to comment.