Commit e1590f48 by ioclubs

ugen-tool

parent c4ebe510
gitUrl=$1
name=$2
git clone --depth=1 -b master ${gitUrl} ${name}
......@@ -21,24 +21,27 @@ module.exports = async () => {
}
let gitUrl, branch;
console.log(config.tpl);
if (!config.tpl[tplName]) {
console.log(config.cloud);
if (!config.cloud[tplName]) {
console.log(chalk.red('\n × Template does not support!'))
return
}
gitUrl = config.tpl[tplName].url
branch = config.tpl[tplName].branch
gitUrl = config.cloud[tplName].url
branch = config.cloud[tplName].branch
console.log('\n fetch repository');
// git命令,远程拉取项目并自定义项目名
let cmdStr = `git clone --depth=1 -b ${branch} ${gitUrl} ${projectName}`
await execSync(cmdStr)
const registry = 'http://company.u-gen.net:7001'
console.log('\n npm install');
await execSync(`cd ${projectName} && npm install --registry=${registry}`);
// // git命令,远程拉取项目并自定义项目名
// let cmdStr = `git clone --depth=1 -b ${branch} ${gitUrl} ${projectName}`
//
// await execSync(cmdStr)
//
// const registry = 'http://company.u-gen.net:7001'
// console.log('\n npm install');
//
// await execSync(`cd ${projectName} && npm install --registry=${registry}`);
await execSync(`sh cloud-init.sh ${gitUrl} ${projectName}`);
console.log(chalk.green('\n √ Generation completed!'));
console.log("bye bye");
}
{
"tpl": {
"cloud": {
"app": {
"url": "http://company.u-gen.net:10080/twb/ugen-cloud-app.git",
"branch": "master"
......
......@@ -12,11 +12,11 @@ program
program
.usage('<command>')
program
.command('init')
.description('Generate a new project')
.command('cloud')
.description('Generate a new cloud project')
.alias('i')
.action(async() => {
await require('./init.js')()
await require('./cloud.js')()
})
program.parse(process.argv)
{
"name": "@ioclubs/ugen-cloud",
"name": "ugen-tool",
"version": "1.0.0",
"description": "ugen cloud",
"description": "ugen tool",
"private": false,
"main": "index.js",
"bin": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment