import * as program from 'commander'; import { PlatformInitManager } from './platform-init-manager'; import i18n from '../../utils/i18n'; import {CommandError} from '../../error/command-error'; const description = `${i18n.__('Initialize a package to be released.')} ${i18n.__('Example')}: $ s platform init $ s platform init -t plugin`; program .name('s platform init') .option('-t, --type ', i18n.__('Package type [Component/Plugin/Application].')) .description(description) .helpOption('-h, --help', i18n.__('Display help for command')) .parse(process.argv); (async () => { if (!program.type) { program.help(); } const platformInitManager = new PlatformInitManager(); platformInitManager.init(program.type); })().catch((err) => { throw new CommandError(err.message); });