From ab5272a07bfe58b4c0587eb4cdb8152ec26120e2 Mon Sep 17 00:00:00 2001 From: Dan Drory Date: Wed, 27 Nov 2024 11:45:31 +1100 Subject: [PATCH] Update commander program to use package.json for settings --- .changeset/olive-cups-kiss.md | 4 ++-- packages/sku/lib/program/index.js | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.changeset/olive-cups-kiss.md b/.changeset/olive-cups-kiss.md index 0c4b21f2f..d23265882 100644 --- a/.changeset/olive-cups-kiss.md +++ b/.changeset/olive-cups-kiss.md @@ -4,8 +4,8 @@ Change the CLI to commander.js. -### Breaking Changes +**BREAKING CHANGE** -SKU now uses [commander.js](https://github.com/tj/commander.js) for its CLI. The CLI options and commands are now more narrowly defined. Some combinations of options that were previously unintended may no longer work. +SKU now uses [commander.js](https://github.com/tj/commander.js) for its CLI. The CLI options and commands are now more narrowly defined and scoped. Some combinations of options that were previously unintended may no longer work. The new `-h, --help` flag now shows the help output generated by commander.js and shows the available commands and options. diff --git a/packages/sku/lib/program/index.js b/packages/sku/lib/program/index.js index faa801396..f074da942 100644 --- a/packages/sku/lib/program/index.js +++ b/packages/sku/lib/program/index.js @@ -4,13 +4,14 @@ const packageManagerOption = require('./options/packageManager/packageManager.op const debugOption = require('./options/debug/debug.option'); const configOption = require('./options/config/config.option'); const environmentOption = require('./options/environment/environment.option'); +const { name, description, version } = require('../../package.json'); const program = new Command(); program - .name('sku') - .description('sku description') - .version('sku version') + .name(name) + .description(description) + .version(version) .allowUnknownOption(true) .addOption(environmentOption) .addOption(configOption)