cleanup
This commit is contained in:
+16
-12
@@ -98,12 +98,6 @@ function downloadNode(version, temp, next) {
|
||||
var tmpPath = path.join(temp, "node-" + version + ".tar.gz"),
|
||||
srcDr = tmpPath.replace(/\.tar.gz$/, "");
|
||||
|
||||
try {
|
||||
|
||||
mkdirp.sync(path.dirname(tmpPath));
|
||||
|
||||
//an error will usually occur when the dir already exists.
|
||||
} catch(e) { }
|
||||
|
||||
step(
|
||||
|
||||
@@ -133,11 +127,14 @@ function downloadNode(version, temp, next) {
|
||||
//source dir exists?
|
||||
if(fs.existsSync(srcDr)) return this();
|
||||
|
||||
console.log("unzipping node source");
|
||||
try {
|
||||
mkdirp.sync(srcDr);
|
||||
} catch(e) {
|
||||
|
||||
}
|
||||
|
||||
//TODO - use native zlib library for this
|
||||
exec(sprintf("tar -xf '%s'", tmpPath), { cwd: path.dirname(tmpPath) }, this);
|
||||
exec(sprintf("tar -xf '%s' -C '%s'", tmpPath, srcDr), { cwd: path.dirname(tmpPath) }, this);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -153,16 +150,23 @@ function downloadNode(version, temp, next) {
|
||||
*/
|
||||
|
||||
function() {
|
||||
|
||||
console.log(srcDr)
|
||||
|
||||
vDir = path.join(srcDr, fs.readdirSync(srcDr).filter(function(dir) {
|
||||
return !/^\./.test(dir);
|
||||
}).pop());
|
||||
|
||||
next(null, {
|
||||
|
||||
//the directory to the node.js file
|
||||
dir: srcDr,
|
||||
dir: vDir,
|
||||
|
||||
releasePath: path.join(srcDr, "out/Release/node"),
|
||||
releasePath: path.join(vDir, "out/Release/node"),
|
||||
|
||||
//makes node.js
|
||||
make: function(next) {
|
||||
var configure = spawn('./configure', [], { cwd: srcDr });
|
||||
var configure = spawn('./configure', [], { cwd: vDir });
|
||||
configure.stdout.on('data', function(data) {
|
||||
process.stdout.write(data.toString());
|
||||
});
|
||||
@@ -170,7 +174,7 @@ function downloadNode(version, temp, next) {
|
||||
process.stderr.write(data.toString());
|
||||
});
|
||||
configure.on('close', function() {
|
||||
var make = spawn('make', [], { cwd: srcDr });
|
||||
var make = spawn('make', [], { cwd: vDir });
|
||||
make.stdout.on('data', function(data) {
|
||||
process.stdout.write(data.toString());
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user