Skip to content

Commit

Permalink
fix(cli): compatible with napi artifacts -d option (#1872)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Dec 28, 2023
1 parent 5825dcc commit 72afe03
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cli/codegen/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'",
},
{
Expand Down
2 changes: 1 addition & 1 deletion cli/docs/artifacts.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
4 changes: 2 additions & 2 deletions cli/src/commands/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
],
],
})
Expand Down
2 changes: 1 addition & 1 deletion cli/src/def/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
})
Expand Down

0 comments on commit 72afe03

Please sign in to comment.