UNPKG

@onboardbase/cli

Version:

[![Version](https://img.shields.io/npm/v/@onboardbase/cli.svg)](https://www.npmjs.com/package/@onboardbase/cli) [![Downloads/week](https://img.shields.io/npm/dw/@onboardbase/cli.svg)](https://www.npmjs.com/package/@onboardbase/cli) [![License](https://img

50 lines (49 loc) 2.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const command_1 = require("@oclif/command"); const auth_service_1 = require("../services/auth.service"); const setup_service_1 = require("../services/setup.service"); const config_1 = require("../config"); class Auth extends command_1.Command { async run() { const { flags, args } = this.parse(Auth); const { overwrite, password, verbose } = flags; const continueAuthProcess = async (executor) => { var _a; const setupService = new setup_service_1.SetupCommandService(new config_1.ConfigManager); await setupService.initialize({ flags: { command: (_a = flags.command) !== null && _a !== void 0 ? _a : args.command, verbose }, args: {}, }); // executor.log("Initiating the command..."); // await CompleteRunProcess({ // flags: { command: flags.command ?? args.command, verbose }, // executor, // }); }; await (0, auth_service_1.CompleteLoginProcess)({ shouldCloseProcess: false, flags: { overwrite, password }, additionalProcesses: { nextFunc: continueAuthProcess, executor: this }, oclifConfig: this.config, }); // await CompleteSetupProcess({ teammate: false }); } } exports.default = Auth; Auth.description = "A one stop command for authenticating, setting up a project and running the project"; Auth.flags = { command: command_1.flags.string({ char: "c", description: "Command to run", required: false, }), help: command_1.flags.help({ char: "h" }), overwrite: command_1.flags.boolean({ default: false, required: false }), password: command_1.flags.string({ description: "Password" }), verbose: command_1.flags.boolean({ default: false, description: "Enable warning/error logs", }), }; Auth.args = [{ name: "command" }];