Skip to content

Commit

Permalink
fix: create new github api client for every method call
Browse files Browse the repository at this point in the history
  • Loading branch information
boennemann committed Sep 29, 2015
1 parent 28e6bc2 commit ccb3ecd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ const promisify = require('es6-promisify')
const contentFromFilename = require('./content-from-filename')
const updateFileWithContent = require('./update-file-with-content')

var github = new GitHubApi({
version: '3.0.0'
})
const repos = mapValues(github.repos, promisify)

module.exports = async function (config, callback) {
const {
branch = 'master',
Expand All @@ -20,8 +15,13 @@ module.exports = async function (config, callback) {
} = config

try {
const github = new GitHubApi({
version: '3.0.0'
})

github.authenticate({type: 'oauth', token})

const repos = mapValues(github.repos, promisify)
const { content, sha } = await contentFromFilename(repos, config)
const newContent = transform(content)

Expand Down

0 comments on commit ccb3ecd

Please sign in to comment.