Skip to content

Commit

Permalink
feat: keep argv ref on update (#916)
Browse files Browse the repository at this point in the history
Co-authored-by: Anton Medvedev <anton@medv.io>
  • Loading branch information
antongolub and antonmedv authored Oct 4, 2024
1 parent ac2f1dd commit 88a545a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/goods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import {
export { default as path } from 'node:path'
export * as os from 'node:os'

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

export function sleep(duration: Duration) {
Expand Down
2 changes: 1 addition & 1 deletion test/goods.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import chalk from 'chalk'
import assert from 'node:assert'
import { test, describe, beforeEach } from 'node:test'
import { test, describe } from 'node:test'
import '../build/globals.js'

describe('goods', () => {
Expand Down

0 comments on commit 88a545a

Please sign in to comment.