diff --git a/bin/vue-init b/bin/vue-init index 1eec8e0f43..08c120dd68 100755 --- a/bin/vue-init +++ b/bin/vue-init @@ -13,6 +13,7 @@ var request = require('request') var logger = require('../lib/logger') var generate = require('../lib/generate') var checkVersion = require('../lib/check-version') +var vue2VersionWarn = require('../lib/vue2-version-warn') /** * Usage. @@ -100,11 +101,15 @@ function run () { checkVersion(function () { if (!hasSlash) { // use official templates - template = 'vuejs-templates/' + template + var officialTemplate = 'vuejs-templates/' + template if (template.indexOf('#') !== -1) { - downloadAndGenerate(template) + downloadAndGenerate(officialTemplate) } else { - checkDistBranch(template, downloadAndGenerate) + // until official webpack template for Vue 2.0 is released in master/dist branch + if (template !== 'webpack') { + vue2VersionWarn(template, inPlace ? '' : name) + } + checkDistBranch(officialTemplate, downloadAndGenerate) } } else { downloadAndGenerate(template) diff --git a/lib/vue2-version-warn.js b/lib/vue2-version-warn.js new file mode 100644 index 0000000000..b98277cb9a --- /dev/null +++ b/lib/vue2-version-warn.js @@ -0,0 +1,10 @@ +var chalk = require('chalk') + +module.exports = function (template, name) { + var vue1InitCommand = 'vue init ' + template + '#1.0' + ' ' + name + + console.log(chalk.red(' This will install Vue 2.x version of template.')) + console.log() + console.log(chalk.yellow(' For Vue 1.x use: ') + chalk.green(vue1InitCommand)) + console.log() +} diff --git a/package.json b/package.json index 67fd077cff..a9a926574d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-cli", - "version": "2.2.0", + "version": "2.3.0", "description": "A simple CLI for scaffolding Vue.js projects.", "preferGlobal": true, "bin": {