Skip to content

Commit

Permalink
fix global config save
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Oct 22, 2014
1 parent 06d77b3 commit c6665bf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ exports.checkDlLoader = function() {
}

var ghh = 'https://raw.githubusercontent.com';
var loaderVersions = ['0.9', '0.9', '0.0.66'];
var loaderVersions = ['0.9', '0.9', '0.0.72'];

function doLoaderDownload(files) {
return Promise.all(Object.keys(files).map(function(url) {
Expand Down
4 changes: 2 additions & 2 deletions lib/endpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ exports.load = function(endpoint) {
// add local as an endpoint if not existing, this way only created when used
if (endpoint == 'local' && !globalConfig.config.endpoints.local) {
globalConfig.config.endpoints.local = {};
config.saveGlobalConfig();
globalConfig.save();
}
if (endpointClasses[endpoint])
return endpointClasses[endpoint];
Expand Down Expand Up @@ -149,7 +149,7 @@ exports.configure = function(endpoint) {
globalConfig.config.endpoints[endpoint] = _config;
})
.then(function() {
config.saveGlobalConfig();
globalConfig.save();
});
}

Expand Down
10 changes: 5 additions & 5 deletions lib/global-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var dprepend = require('./common').dprepend;
// global config - automatically created and loaded on startup
exports.endpoints = [];
var globalConfigFile = HOME + path.sep + '.jspm' + path.sep + 'config';
function saveGlobalConfig() {
function save() {
try {
fs.mkdirSync(HOME + path.sep + '.jspm');
}
Expand All @@ -50,9 +50,9 @@ if (fs.existsSync(globalConfigFile)) {
else {
exports.config = {};
if (HOME)
saveGlobalConfig();
save();
}
exports.saveGlobalConfig = saveGlobalConfig;
exports.save = save;

/*
* Populate default endpoint configuration
Expand Down Expand Up @@ -80,7 +80,7 @@ if (exports.config.github) {
dprepend(exports.config.endpoints.github, exports.config.github);
delete exports.config.github;
}
saveGlobalConfig();
save();

exports.set = function(name, val) {
var nameParts = name.split('.');
Expand All @@ -100,5 +100,5 @@ exports.set = function(name, val) {
delete config[nameParts[0]];
}

saveGlobalConfig();
save();
}

0 comments on commit c6665bf

Please sign in to comment.