Skip to content

Commit

Permalink
Fixes RallyApps#74
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Ferentchak committed Jun 2, 2017
1 parent 6452633 commit 0593fdd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
8 changes: 1 addition & 7 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,11 @@ let _updateConfig = function(config){
return config;
};

let saveConfig = function({path, config}, callback=()=>0 ){
let configPath = pathUtils.join(path, configFileName);
return fs.writeFile(configPath, JSON.stringify(config, null, ' '), callback);
};

let getConfig = function(path, callback) {
let convertToJson = function(error, file){
if (!error) {
let config = JSON.parse(file);
_updateConfig(config);
saveConfig({config, path});
return callback(null, config);
} else {
return callback(error);
Expand Down Expand Up @@ -47,5 +41,5 @@ let getAppSourceRoot = (path, callback) =>
})
;

module.exports = {_updateConfig,getConfig,saveConfig,getAppSourceRoot};
module.exports = {getConfig,getAppSourceRoot};
_.defaults(module.exports, {configFileName});
4 changes: 0 additions & 4 deletions test/config.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ describe('Config', function(){
"rallyapps/ninjas"
]
};

let updatedConfig = config._updateConfig(testConfig);
return it("should add a server to the config file if one is not present",
()=> assert(updatedConfig.server === "https://rally1.rallydev.com"));
});

return describe('#getAppSourceRoot', function() {
Expand Down

0 comments on commit 0593fdd

Please sign in to comment.