Skip to content

Commit

Permalink
feat: add option merge to command create
Browse files Browse the repository at this point in the history
  • Loading branch information
zyy7259 committed Dec 5, 2019
1 parent 6c24964 commit e1363c7
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 e1363c7

Please sign in to comment.