This commit is contained in:
Craig Condon
2013-10-14 10:40:46 -07:00
parent a9a97fefe1
commit 3b1b82dc40
+16 -12
View File
@@ -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());
});