feat: add option merge to command create (#4828)

This commit is contained in:
Yingya Zhang
2020-01-06 10:16:34 +08:00
committed by Pavan Kumar Sunkara
parent 80b93951b1
commit 2531d10086
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -63,6 +63,7 @@ program
.option('-g, --git [message]', 'Force git initialization with initial commit message')
.option('-n, --no-git', 'Skip git initialization')
.option('-f, --force', 'Overwrite target directory if it exists')
.option('--merge', 'Merge target directory if it exists')
.option('-c, --clone', 'Use git clone when fetching remote preset')
.option('-x, --proxy', 'Use specified proxy when creating project')
.option('-b, --bare', 'Scaffold project without beginner instructions')
+1 -1
View File
@@ -29,7 +29,7 @@ async function create (projectName, options) {
exit(1)
}
if (fs.existsSync(targetDir)) {
if (fs.existsSync(targetDir) && !options.merge) {
if (options.force) {
await fs.remove(targetDir)
} else {