UNPKG

@sinotron/cli

Version:

Simple framework for Typescript Electron projects

22 lines (21 loc) 859 B
import { CliHelper } from '../cli.helper.js'; import { FrameworkSetup } from './FrameworkSetup.js'; import { ProgramLaunchHelper } from '../../utils/program-launch-helper.js'; export class SetupCommand { static init(app) { app.command('setup') .description('Setup the Sinotron framework in the current project root.') .option('-f, --force', 'Overwrite framework directory if exists') .option('--vscode', 'Launch the project in VSCode') .action(async (...args) => { const ctx = CliHelper.getContext(args); await FrameworkSetup.run({ force: ctx.options.force }); const projectRoot = process.cwd(); if (ctx.options?.vscode === true) { ProgramLaunchHelper.vscode(projectRoot); } }); } }