Skip to content

Commit

Permalink
♻️ Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
re-fort committed Dec 29, 2017
1 parent b14e70f commit 71c171d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ let repo = new Repo(
}
)

function setup() {
const setup = () => {
repo.setup()
github.authenticate({ type: 'token', token: process.env.GITHUB_ACCESS_TOKEN })
setupUpstreamFeeder()
setupHeadFeeder()
}

function setupHeadFeeder() {
const setupHeadFeeder = () => {
headFeeder.add({
url: process.env.HEAD_FEED_URL,
refresh: Number(process.env.HEAD_FEED_REFRESH),
Expand Down Expand Up @@ -95,7 +95,7 @@ function setupHeadFeeder() {
})
}

function setupUpstreamFeeder() {
const setupUpstreamFeeder = () => {
upstreamFeeder.add({
url: process.env.UPSTREAM_FEED_URL,
refresh: Number(process.env.UPSTREAM_FEED_REFRESH),
Expand All @@ -110,12 +110,12 @@ function setupUpstreamFeeder() {
})
}

function removeHeadFeeder() {
const removeHeadFeeder = () => {
headFeeder.off('new-item')
headFeeder.destroy()
}

async function after(item, shortHash, issueNo = null) {
const after = async (item, shortHash, issueNo = null) => {
const body = issueNo ? `This PR resolves #${issueNo}\r\nCherry picked from ${item.link}` : `Cherry picked from ${item.link}`
const { data: pullRequest } = await github.createPullRequest(remote, { title: Utility.removeHash(item.title), body, branch: shortHash })
if (!pullRequest) return
Expand Down

0 comments on commit 71c171d

Please sign in to comment.