Created
May 2, 2014 12:11
-
-
Save TerryMooreII/0b0ecb46d9dbe94f8860 to your computer and use it in GitHub Desktop.
Code to execute the bash script and send the response message - Cardinal Solutions ALF blog post
This file contains hidden or 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
var executeCommand = function(obj){ | |
exec(obj.cmd, function(err, stdout, stderr){ | |
var data = { | |
error: err, | |
stdout:stdout, | |
stderr: stderr | |
} | |
if (!writeToLog(obj.projectName, obj.service, data)){ | |
errorResponse(response, 'Unable to write to log directory, check permissions') | |
} | |
obj.response.setHeader('Content-type', 'application/json'); | |
obj.response.status(200).end(JSON.stringify(data)); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment