fix(cli): compatible with napi artifacts -d option (#1872)

This commit is contained in:
LongYinan 2023-12-28 12:16:07 +08:00 committed by GitHub
parent 5825dcc3a6
commit 72afe03aa4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View file

@ -319,7 +319,7 @@ const ARTIFACTS_OPTIONS: CommandSchema = {
type: 'string',
description:
'Path to the folder where all built `.node` files put, same as `--output-dir` of build command',
short: ['o'],
short: ['o', 'd'],
default: "'./artifacts'",
},
{

View file

@ -28,5 +28,5 @@ new NapiCli().artifacts({
| cwd | --cwd | string | false | process.cwd() | The working directory of where napi command will be executed in, all other paths options are relative to this path |
| configPath | --config-path,-c | string | false | | Path to `napi` config json file |
| packageJsonPath | --package-json-path | string | false | 'package.json' | Path to `package.json` |
| outputDir | --output-dir,-o | string | false | './artifacts' | Path to the folder where all built `.node` files put, same as `--output-dir` of build command |
| outputDir | --output-dir,-o,-d | string | false | './artifacts' | Path to the folder where all built `.node` files put, same as `--output-dir` of build command |
| npmDir | --npm-dir | string | false | 'npm' | Path to the folder where the npm packages put |

View file

@ -8,9 +8,9 @@ export class ArtifactsCommand extends BaseArtifactsCommand {
description: 'Copy artifacts from Github Actions into specified dir',
examples: [
[
'$0 artifacts --dir . --dist ./npm',
'$0 artifacts --output-dir ./artifacts --dist ./npm',
`Copy [binaryName].[platform].node under current dir(.) into packages under npm dir.
e.g: index.linux-x64-gnu.node --> ./npm/linux-x64-gnu/index.node`,
e.g: index.linux-x64-gnu.node --> ./npm/linux-x64-gnu/index.linux-x64-gnu.node`,
],
],
})

View file

@ -23,7 +23,7 @@ export abstract class BaseArtifactsCommand extends Command {
description: 'Path to `package.json`',
})
outputDir = Option.String('--output-dir,-o', './artifacts', {
outputDir = Option.String('--output-dir,-o,-d', './artifacts', {
description:
'Path to the folder where all built `.node` files put, same as `--output-dir` of build command',
})