Created
August 17, 2014 05:39
-
-
Save verma/7d835923eda61c18e65d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extractStream(req, function(err, dirname) { | |
if (err) | |
return res.json(500, {status: false, message: err.message}); | |
cp.exec("npm install", { | |
cwd: dirname | |
}, function(err, stdout, stderr) { | |
if (err) | |
return res.json({status: false, message: err.message}); | |
debug("npm install finished on dirname"); | |
debug("Now spawing process..."); | |
var p = cp.spawn("saskavi", ["run"], { | |
cwd: dirname, | |
uid: 1002, | |
gid: 1002 | |
}); | |
p.on('close', function() { | |
debug("Process closed for", dirname); | |
}); | |
var id = uuid.v4(); | |
debug("Process spawned, assigned id:", id); | |
res.json({ | |
status: true, | |
id: id | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment