Skip to content

Commit 0a33f99

Browse files
committed
Better local template handling with Windows compatability
1 parent e632a65 commit 0a33f99

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

bin/vue-init

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ process.on('exit', function () {
6464
var template = program.args[0]
6565
var hasSlash = template.indexOf('/') > -1
6666
var rawName = program.args[1]
67+
var templatePath = path.normalize(path.join(process.cwd(), template))
6768
var inPlace = !rawName || rawName === '.'
6869
var name = inPlace ? path.relative('../', process.cwd()) : rawName
6970
var to = path.resolve(rawName || '.')
@@ -91,8 +92,8 @@ if (exists(to)) {
9192

9293
function run () {
9394
// check if template is local
94-
if (hasSlash && exists(template)) {
95-
generate(name, template, to, function (err) {
95+
if (exists(templatePath)) {
96+
generate(name, templatePath, to, function (err) {
9697
if (err) logger.fatal(err)
9798
console.log()
9899
logger.success('Generated "%s".', name)

0 commit comments

Comments
 (0)