cli: Add admin skeleton command

Signed-off-by: Marcus Eide <eide@spotify.com>
This commit is contained in:
Marcus Eide
2023-02-09 09:09:33 +01:00
committed by Philipp Hugenroth
parent ccb26dc545
commit 1322688118
3 changed files with 56 additions and 0 deletions
@@ -0,0 +1,31 @@
/*
* Copyright 2023 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import chalk from 'chalk';
import inquirer from 'inquirer';
import { Task } from '../../lib/tasks';
export async function command(): Promise<void> {
const answers = await inquirer.prompt<{ github: boolean }>([
{
type: 'confirm',
name: 'github',
message: chalk.blue('Do you want to set up GitHub Authentication?'),
},
]);
Task.log(answers.github ? 'Ok!' : 'Maybe next time');
}
+17
View File
@@ -0,0 +1,17 @@
/*
* Copyright 2023 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { command } from './command';
+8
View File
@@ -25,6 +25,13 @@ const configOption = [
Array<string>(),
] as const;
export function registerAdminCommand(program: Command) {
program
.command('admin')
.description('Get help setting up your Backstage App.')
.action(lazy(() => import('./admin').then(m => m.command)));
}
export function registerRepoCommand(program: Command) {
const command = program
.command('repo [command]')
@@ -360,6 +367,7 @@ export function registerCommands(program: Command) {
registerRepoCommand(program);
registerScriptCommand(program);
registerMigrateCommand(program);
registerAdminCommand(program);
program
.command('versions:bump')