diff options
Diffstat (limited to 'scripts/cmd/copy.js')
-rw-r--r-- | scripts/cmd/copy.js | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/scripts/cmd/copy.js b/scripts/cmd/copy.js index 943c998df..948ed114f 100644 --- a/scripts/cmd/copy.js +++ b/scripts/cmd/copy.js @@ -1,19 +1,20 @@ -import arg from 'arg'; import { globby as glob } from 'globby'; import { promises as fs, readFileSync } from 'node:fs'; import { posix } from 'node:path'; +import { parseArgs } from 'node:util'; import * as tar from 'tar/create'; const { resolve, dirname, sep, join } = posix; -/** @type {import('arg').Spec} */ -const spec = { - '--tgz': Boolean, -}; - export default async function copy() { - let { _: patterns, ['--tgz']: isCompress } = arg(spec); - patterns = patterns.slice(1); + const args = parseArgs({ + allowPositionals: true, + options: { + tgz: { type: 'boolean' }, + }, + }); + const patterns = args.positionals.slice(1); + const isCompress = args.values.tgz; if (isCompress) { const files = await glob(patterns, { gitignore: true }); |