diff options
author | 2024-08-14 12:52:42 +0200 | |
---|---|---|
committer | 2024-08-14 12:52:42 +0200 | |
commit | e853526c39eef78b843cc0666985cef1d5dda5fa (patch) | |
tree | a6f7f4ec5ed7088390642a1d967e8e802eb36682 /scripts/cmd/copy.js | |
parent | e90f5593d23043579611452a84b9e18ad2407ef9 (diff) | |
parent | a79a8b0230b06ed32ce1802f2a5f84a6cf92dbe7 (diff) | |
download | astro-e853526c39eef78b843cc0666985cef1d5dda5fa.tar.gz astro-e853526c39eef78b843cc0666985cef1d5dda5fa.tar.zst astro-e853526c39eef78b843cc0666985cef1d5dda5fa.zip |
Merge branch 'main' into next
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 }); |