Skip to content

Commit ec8e8a8

Browse files
committed
feat: add option merge to command create
1 parent 4087220 commit ec8e8a8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

packages/@vue/cli/bin/vue.js

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ program
6363
.option('-g, --git [message]', 'Force git initialization with initial commit message')
6464
.option('-n, --no-git', 'Skip git initialization')
6565
.option('-f, --force', 'Overwrite target directory if it exists')
66+
.option('--merge', 'Merge target directory if it exists')
6667
.option('-c, --clone', 'Use git clone when fetching remote preset')
6768
.option('-x, --proxy', 'Use specified proxy when creating project')
6869
.option('-b, --bare', 'Scaffold project without beginner instructions')

packages/@vue/cli/lib/create.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async function create (projectName, options) {
2929
exit(1)
3030
}
3131

32-
if (fs.existsSync(targetDir)) {
32+
if (fs.existsSync(targetDir) && !options.merge) {
3333
if (options.force) {
3434
await fs.remove(targetDir)
3535
} else {

0 commit comments

Comments
 (0)