sinotron
Version:
Simple framework for Typescript Electron projects
22 lines (21 loc) • 830 B
JavaScript
import { CliHelper } from '../cli.helper.js';
import { FrameworkFactory } from './FrameworkFactory.js';
import { LaunchUtil } from '../../utils/launch-util.js';
export class SetupCommand {
static init(app) {
app.command('setup')
.description('Setup the 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 FrameworkFactory.setup({
force: ctx.options.force
});
const projectRoot = process.cwd();
if (ctx.options?.vscode === true) {
LaunchUtil.vscode(projectRoot);
}
});
}
}