In a shell script execution callback, I'm sending a POST request to a service, but for some reason I get Error: [TypeError: object is not a function]
. This is my code:
exec('./scripts/update.sh', function(err, stdout, stderr) {
if (!err) {
request('https://api.rollbar.com')
.post('/api/1/deploy/')
.send({
access_token: token,
environment: 'production',
revision: commitSHA
})
.end(function(err, res) {
if (!err) {
console.log('%s: sent deploy information to Rollbar', (new Date()).toLocaleString());
}
});
}
});