Skip to content

Commit

Permalink
Merge pull request vuejs#194 from presidenten/master
Browse files Browse the repository at this point in the history
Better local template handling with Windows compatability
  • Loading branch information
zigomir authored Nov 2, 2016
2 parents 42ea2fc + cd312e7 commit 1795cc1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bin/vue-init
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ process.on('exit', function () {
var template = program.args[0]
var hasSlash = template.indexOf('/') > -1
var rawName = program.args[1]
var templatePath = exists(template) ? template : path.normalize(path.join(process.cwd(), template))
var inPlace = !rawName || rawName === '.'
var name = inPlace ? path.relative('../', process.cwd()) : rawName
var to = path.resolve(rawName || '.')
Expand Down Expand Up @@ -91,8 +92,8 @@ if (exists(to)) {

function run () {
// check if template is local
if (hasSlash && exists(template)) {
generate(name, template, to, function (err) {
if (exists(templatePath)) {
generate(name, templatePath, to, function (err) {
if (err) logger.fatal(err)
console.log()
logger.success('Generated "%s".', name)
Expand Down

0 comments on commit 1795cc1

Please sign in to comment.