Skip to content

Commit 88a545a

Browse files
feat: keep argv ref on update (google#916)
Co-authored-by: Anton Medvedev <anton@medv.io>
1 parent ac2f1dd commit 88a545a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/goods.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ import {
2727
export { default as path } from 'node:path'
2828
export * as os from 'node:os'
2929

30-
export let argv = minimist(process.argv.slice(2))
30+
export const argv = minimist(process.argv.slice(2))
3131
export function updateArgv(args: string[]) {
32-
argv = minimist(args)
33-
;(global as any).argv = argv
32+
for (var k in argv) delete argv[k]
33+
Object.assign(argv, minimist(args))
3434
}
3535

3636
export function sleep(duration: Duration) {

test/goods.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import chalk from 'chalk'
1616
import assert from 'node:assert'
17-
import { test, describe, beforeEach } from 'node:test'
17+
import { test, describe } from 'node:test'
1818
import '../build/globals.js'
1919

2020
describe('goods', () => {

0 commit comments

Comments
 (0)