mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-04-22 12:28:44 -05:00
feat: add option merge to command create (#4828)
This commit is contained in:
committed by
Pavan Kumar Sunkara
parent
80b93951b1
commit
2531d10086
@@ -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')
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user