@tuoyuan/cli
Version:
拓源网络脚手架
58 lines (57 loc) • 1.46 kB
JavaScript
/**
* @description 获取输入配置
*
*/
// 获取远程地址配置
function getGitConfig(){
return ([
{
name: 'admin',
url: 'http://gitlab.iot1234.com:9090/web-infra/cli-admin-template'
},
{
name: 'admin-pro',
url: 'http://gitlab.iot1234.com:9090/web-infra/cli-admin-pro-template'
},
{
name: 'screen',
url: 'http://gitlab.iot1234.com:9090/web-infra/cli-screen-template'
},
{
name: 'h5',
url: 'http://gitlab.iot1234.com:9090/web-infra/cli-uni-template'
},
{
name: 'docs',
url: 'http://gitlab.iot1234.com:9090/web-infra/cli-docs-template'
},
{
name: 'component',
url: 'http://gitlab.iot1234.com:9090/web-infra/cli-component-template'
},
{
name: 'module-page',
url: 'http://gitlab.iot1234.com:9090/web-infra/cli-module-page-template'
},
])
}
function getInputConfig() {
return([
{
type: 'input',
name: 'name',
message: '请输入项目名称:',
default: 'my-project'
},
{
type: 'list',
name: 'project',
message: '请选择模板文件:',
choices: getGitConfig().map(item => item.name),
default: getGitConfig()[0].name
},
])
}
export {
getInputConfig,getGitConfig
}