Corrected yet another bug in creating a temporary directory

This commit is contained in:
Jia Hao 2015-07-05 17:02:09 +08:00
parent 594607080e
commit 397567a4e7
1 changed files with 3 additions and 4 deletions

View File

@ -6,7 +6,6 @@ var fs = require('fs');
var temp = require('temp').track();
var ncp = require('ncp').ncp;
/**
* @callback tempDirCallback
* @param error
@ -24,10 +23,10 @@ var ncp = require('ncp').ncp;
module.exports = function (name, targetURL, callback) {
var tempDir = temp.path();
ncp('./app', tempDir, function (error) {
ncp(__dirname + '/app', tempDir, function (error) {
if (error) {
callback('Error creating temporary directory', null);
console.error(error);
callback('Error Copying temporary directory\n' + error, null);
} else {