From 72afe03aa4c097ecf14f43d9558f6af4db0e1546 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Thu, 28 Dec 2023 12:16:07 +0800 Subject: [PATCH] fix(cli): compatible with napi artifacts -d option (#1872) --- cli/codegen/commands.ts | 2 +- cli/docs/artifacts.md | 2 +- cli/src/commands/artifacts.ts | 4 ++-- cli/src/def/artifacts.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cli/codegen/commands.ts b/cli/codegen/commands.ts index 1f0d1a20..58d35d8a 100644 --- a/cli/codegen/commands.ts +++ b/cli/codegen/commands.ts @@ -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'", }, { diff --git a/cli/docs/artifacts.md b/cli/docs/artifacts.md index 0638900b..66d7f96a 100644 --- a/cli/docs/artifacts.md +++ b/cli/docs/artifacts.md @@ -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 | diff --git a/cli/src/commands/artifacts.ts b/cli/src/commands/artifacts.ts index 195db18f..77d02a1e 100644 --- a/cli/src/commands/artifacts.ts +++ b/cli/src/commands/artifacts.ts @@ -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`, ], ], }) diff --git a/cli/src/def/artifacts.ts b/cli/src/def/artifacts.ts index 2e74c82b..49bd17b0 100644 --- a/cli/src/def/artifacts.ts +++ b/cli/src/def/artifacts.ts @@ -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', })