From 5b464cee3045d570f9a92b074bbc6a0d0c919166 Mon Sep 17 00:00:00 2001 From: Anton Date: Sun, 3 Jul 2022 12:27:34 +0300 Subject: [PATCH] feat: set default $.cwd --- src/main/js/index.mjs | 3 +++ src/test/js/test.mjs | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/main/js/index.mjs b/src/main/js/index.mjs index 7853335..b72e561 100644 --- a/src/main/js/index.mjs +++ b/src/main/js/index.mjs @@ -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) => diff --git a/src/test/js/test.mjs b/src/test/js/test.mjs index 9930ff0..71e00ec 100644 --- a/src/test/js/test.mjs +++ b/src/test/js/test.mjs @@ -144,3 +144,8 @@ import {$, semver, createHook, ip, tempy, tcping, sleep, ctx} from '../../main/j $.verbose = 2 }) } + +// $.cwd +{ + assert.ok($.cwd === process.cwd()) +}