Merge pull request #10617 from backstage/freben/bump-commander

Bump commander to version 9.1.0
This commit is contained in:
Fredrik Adelöw
2022-04-20 11:50:29 +02:00
committed by GitHub
53 changed files with 309 additions and 285 deletions
+7 -7
View File
@@ -15,7 +15,7 @@
*/
import chalk from 'chalk';
import { Command } from 'commander';
import { OptionValues } from 'commander';
import inquirer, { Answers } from 'inquirer';
import { resolve as resolvePath } from 'path';
import { findPaths } from '@backstage/cli-common';
@@ -30,7 +30,7 @@ import {
templatingTask,
} from './lib/tasks';
export default async (cmd: Command): Promise<void> => {
export default async (opts: OptionValues): Promise<void> => {
/* eslint-disable-next-line no-restricted-syntax */
const paths = findPaths(__dirname);
@@ -65,22 +65,22 @@ export default async (cmd: Command): Promise<void> => {
// Use `--path` argument as application directory when specified, otherwise
// create a directory using `answers.name`
const appDir = cmd.path
? resolvePath(paths.targetDir, cmd.path)
const appDir = opts.path
? resolvePath(paths.targetDir, opts.path)
: resolvePath(paths.targetDir, answers.name);
Task.log();
Task.log('Creating the app...');
try {
if (cmd.path) {
if (opts.path) {
// Template directly to specified path
Task.section('Checking that supplied path exists');
await checkPathExistsTask(appDir);
Task.section('Preparing files');
await templatingTask(templateDir, cmd.path, answers);
await templatingTask(templateDir, opts.path, answers);
} else {
// Template to temporary location, and then move files
@@ -97,7 +97,7 @@ export default async (cmd: Command): Promise<void> => {
await moveAppTask(tempDir, appDir, answers.name);
}
if (!cmd.skipInstall) {
if (!opts.skipInstall) {
Task.section('Building the app');
await buildAppTask(appDir);
}
+1 -1
View File
@@ -20,7 +20,7 @@
* @packageDocumentation
*/
import program from 'commander';
import { program } from 'commander';
import { exitWithError } from './lib/errors';
import { version } from '../package.json';
import createApp from './createApp';