Skip to content

Commit a6bdd73

Browse files
committed
feat: add option merge to command create
1 parent 1c41371 commit a6bdd73

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
@@ -64,6 +64,7 @@ program
6464
.option('-g, --git [message]', 'Force git initialization with initial commit message')
6565
.option('-n, --no-git', 'Skip git initialization')
6666
.option('-f, --force', 'Overwrite target directory if it exists')
67+
.option('--merge', 'Merge target directory if it exists')
6768
.option('-c, --clone', 'Use git clone when fetching remote preset')
6869
.option('-x, --proxy', 'Use specified proxy when creating project')
6970
.option('-b, --bare', 'Scaffold project without beginner instructions')

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

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

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

0 commit comments

Comments
 (0)