From 57797f341d7cad1b28804021a52c98c78b21bf3a Mon Sep 17 00:00:00 2001 From: Alex Canessa Date: Fri, 13 Nov 2015 08:28:21 +0000 Subject: [PATCH] Bit of refactoring --- github-release-notes.js | 3 +- src/index.js | 142 +++++++++++++++++++++------------------- 2 files changed, 76 insertions(+), 69 deletions(-) diff --git a/github-release-notes.js b/github-release-notes.js index 455e9c8f..ea23b3f4 100644 --- a/github-release-notes.js +++ b/github-release-notes.js @@ -1,4 +1,3 @@ 'use strict'; -var githubReleaseNotes = require('./lib/index'); -githubReleaseNotes.init(); \ No newline at end of file +var githubReleaseNotes = require('./lib/index'); \ No newline at end of file diff --git a/src/index.js b/src/index.js index c3e114ad..fbb7ffcb 100644 --- a/src/index.js +++ b/src/index.js @@ -1,38 +1,12 @@ 'use strict'; var Github = require('github-api'); -var options = getOptions(process.argv); -var token = options.token; -var username = options.username; -var repositoryName = options.repo; -var releasePrefix = options.prefix || ''; -var github = new Github({ - token: token, - auth: "oauth" -}); -var repo = github.getRepo(username, repositoryName); - -/** - * Create a literal object of the node module options - * - * @param {Array} args The array of arguments (the module arguments start from index 2) - * - * @return {Object} The object containg the key/value options - */ -function getOptions(args) { - var settings = {}; - - for(var i=2;i