Skip to content

Commit 2f9adf8

Browse files
committed
Download the template repo into system default temp dir, to avoid the unnecessary tmp folder auto-creation on Windows.
1 parent 2a3431f commit 2f9adf8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bin/vue-init

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
var download = require('download-git-repo')
44
var program = require('commander')
55
var exists = require('fs').existsSync
6+
var os = require('os')
67
var path = require('path')
78
var rm = require('rimraf').sync
89
var uid = require('uid')
@@ -155,7 +156,7 @@ function checkDistBranch (template, cb) {
155156
*/
156157

157158
function downloadAndGenerate (template) {
158-
var tmp = '/tmp/vue-template-' + uid()
159+
var tmp = os.tmpdir() + '/vue-template-' + uid()
159160
var spinner = ora('downloading template')
160161
spinner.start()
161162
download(template, tmp, { clone: clone }, function (err) {

0 commit comments

Comments
 (0)