Comparing version 0.7.0 to 0.7.1
@@ -1,3 +0,1 @@ | ||
const program = require('commander'); | ||
@@ -21,4 +19,2 @@ const path = require('path'); | ||
go().then(()=>{ | ||
@@ -45,3 +41,12 @@ console.log(logSymbols.success,chalk.green('创建成功:)')); | ||
//判断是否存在该目录 | ||
if(list.length){ | ||
if(projectName === rootName){ | ||
next = inquirer.prompt({ | ||
name:'buildInCurrent', | ||
message:'在当前目录下创建新项目?', | ||
type:'confirm', | ||
default:true | ||
}).then(answer=>{ | ||
resolve(answer.buildInCurrent ? '.': projectName); | ||
}) | ||
}else if(list.length){ | ||
if(list.filter(name =>{ | ||
@@ -56,11 +61,2 @@ const fileName = path.resolve(process.cwd(),path.join('.',name)); | ||
} | ||
}else if(projectName == rootName){ | ||
next = inquirer.prompt({ | ||
name:'buildInCurrent', | ||
message:'当前目录为空,且项目名称和目录名称相同,在当前目录下创建新项目?', | ||
type:'confirm', | ||
default:true | ||
}).then(answer=>{ | ||
resolve(answer.buildInCurrent ? '.': projectName); | ||
}) | ||
}else{ | ||
@@ -67,0 +63,0 @@ resolve(projectName); |
@@ -51,3 +51,10 @@ const Metalsmith = require('metalsmith'); | ||
}).build(err => { | ||
const templateFolder = path.basename(glob.sync(dest+'/*')[0]) | ||
let templateFolder = "vue"; | ||
if(metadata.Skeleton){ | ||
templateFolder = "skeleton"; | ||
}else if(metadata.TypeScript){ | ||
templateFolder = "ts"; | ||
}else if(metadata.vuex){ | ||
templateFolder = "vuex"; | ||
} | ||
const list = glob.sync(dest+'/'+templateFolder+'/{**,.*}') | ||
@@ -60,3 +67,3 @@ | ||
const isDir = fs.statSync(name).isDirectory(); | ||
!isDir && fsExtra.moveSync(source,target,err=>{ | ||
!isDir && fsExtra.moveSync(source,target,{overwrite:true},err=>{ | ||
if(err) console.error(err); | ||
@@ -63,0 +70,0 @@ }); |
{ | ||
"name": "gaea-cli", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"description": "gaea-cli", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19111
284
9