Skip to content
This repository has been archived by the owner on Nov 4, 2022. It is now read-only.

Commit

Permalink
Modularizing code. Fixing issue that made gh die the first time it wa…
Browse files Browse the repository at this point in the history
…s invoked.

Improving 255b1b7.
  • Loading branch information
henvic committed Mar 16, 2015
1 parent a391c5c commit 6f1e1af
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
21 changes: 11 additions & 10 deletions lib/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ var configs = require('./configs'),
Github = require('github'),
path = require('path'),
tracker = require('./tracker'),
updateNotifier = require('update-notifier'),
baseConfig;
updateNotifier = require('update-notifier');

// -- Config -------------------------------------------------------------------

Expand All @@ -25,15 +24,17 @@ exports.clone = function(o) {

// -- Utils --------------------------------------------------------------------

baseConfig = configs.getConfig();
exports.load = function() {
var config = configs.getConfig();

exports.github = new Github({
debug: false,
host: baseConfig.api.host,
protocol: baseConfig.api.protocol,
version: baseConfig.api.version,
pathPrefix: baseConfig.api.pathPrefix
});
exports.github = new Github({
debug: false,
host: config.api.host,
protocol: config.api.protocol,
version: config.api.version,
pathPrefix: config.api.pathPrefix
});
};

exports.asyncReadPackages = function(callback) {
function async(err, data) {
Expand Down
3 changes: 3 additions & 0 deletions lib/cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ exports.run = function() {
configs.createGlobalConfig();
}

base.load();
configs.getConfig();

// If configs.PLUGINS_PATH_KEY is undefined, try to cache it before proceeding.
if (configs.getConfig()[configs.PLUGINS_PATH_KEY] === undefined) {
configs.getNodeModulesGlobalPath();
Expand Down

0 comments on commit 6f1e1af

Please sign in to comment.