Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
bugfix
  • Loading branch information
jaredly committed Nov 1, 2013
1 parent b08e603 commit d62e39b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions webapp.js
Expand Up @@ -66,7 +66,7 @@ module.exports = {
});

app.get('/apps/:id', function (req, res) {
var config = req.user.jobplugins.heroku
var config = req.user.jobPluginData('heroku') || {}
if (!config || !config.accounts) return res.send(404, 'Account not found')
var account;
for (var i=0; i<config.accounts.length; i++) {
Expand All @@ -88,7 +88,7 @@ module.exports = {
})

app.del('/account/:id', function (req, res) {
var config = req.user.jobplugins.heroku
var config = req.user.jobPluginData('heroku') || {}
if (!config || !config.accounts) return res.send(404, 'Account not found')
var account;
for (var i=0; i<config.accounts.length; i++) {
Expand Down
4 changes: 3 additions & 1 deletion worker.js
Expand Up @@ -4,13 +4,15 @@ var git = require('strider-git/lib')
module.exports = {
init: function (userConfig, config, job, context, cb) {
var account
, err = new Error('Heroku invalid configuration. Account not found')
if (!userConfig) return cb(err)
for (var i=0; i<userConfig.accounts.length; i++) {
if (userConfig.accounts[i].id === config.app.account) {
account = userConfig.accounts[i]
break;
}
}
if (!account) return cb(new Error('Heroku invalid configuration. Account not found'))
if (!account) return cb(err)
cb(null, {
deploy: function (context, done) {
var cmd = 'git push ' + config.app.git_url + ' ' + context.branch + ':master'
Expand Down

0 comments on commit d62e39b

Please sign in to comment.