Skip to content

Commit

Permalink
feat: add option merge to command create (#4828)
Browse files Browse the repository at this point in the history
  • Loading branch information
zyy7259 authored and pksunkara committed Jan 6, 2020
1 parent 80b9395 commit 2531d10
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/@vue/cli/bin/vue.js
Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli/lib/create.js
Expand Up @@ -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 {
Expand Down

0 comments on commit 2531d10

Please sign in to comment.