Skip to content

Commit b20f649

Browse files
committed
Remove checkDistBranch
also `webpack` template now supports Vue 2.0.
1 parent 6ee0176 commit b20f649

File tree

2 files changed

+4
-33
lines changed

2 files changed

+4
-33
lines changed

bin/vue-init

+3-32
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ var uid = require('uid')
1010
var ora = require('ora')
1111
var chalk = require('chalk')
1212
var inquirer = require('inquirer')
13-
var request = require('request')
1413
var logger = require('../lib/logger')
1514
var generate = require('../lib/generate')
1615
var checkVersion = require('../lib/check-version')
@@ -110,11 +109,9 @@ function run () {
110109
warnings.v2SuffixTemplatesDeprecated(template, inPlace ? '' : name)
111110
return
112111
}
113-
// until official webpack template for Vue 2.0 is released in master/dist branch
114-
if (template !== 'webpack') {
115-
warnings.v2BranchIsNowDefault(template, inPlace ? '' : name)
116-
}
117-
checkDistBranch(officialTemplate, downloadAndGenerate)
112+
113+
warnings.v2BranchIsNowDefault(template, inPlace ? '' : name)
114+
downloadAndGenerate(officialTemplate)
118115
}
119116
} else {
120117
downloadAndGenerate(template)
@@ -123,32 +120,6 @@ function run () {
123120
}
124121
}
125122

126-
/**
127-
* Check if the template has a dist branch, if yes, use that.
128-
*
129-
* @param {String} template
130-
* @param {Function} cb
131-
*/
132-
133-
function checkDistBranch (template, cb) {
134-
request({
135-
url: 'https://api.github.com/repos/' + template + '/branches',
136-
headers: {
137-
'User-Agent': 'vue-cli'
138-
}
139-
}, function (err, res, body) {
140-
if (err) logger.fatal(err)
141-
if (res.statusCode !== 200) {
142-
logger.fatal('Template does not exist: ' + template)
143-
} else {
144-
var hasDist = JSON.parse(body).some(function (branch) {
145-
return branch.name === 'dist'
146-
})
147-
return cb(hasDist ? template + '#dist' : template)
148-
}
149-
})
150-
}
151-
152123
/**
153124
* Download a generate from a template repo.
154125
*

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-cli",
3-
"version": "2.3.2",
3+
"version": "2.3.3",
44
"description": "A simple CLI for scaffolding Vue.js projects.",
55
"preferGlobal": true,
66
"bin": {

0 commit comments

Comments
 (0)