init before renew

This commit is contained in:
AJ ONeal 2019-10-31 06:20:49 -06:00
parent 72ccd8f3b7
commit fa8d1d76b3
2 changed files with 14 additions and 4 deletions

View File

@ -261,9 +261,11 @@ G.create = function(gconf) {
// needs to get info about the renewal, such as which store and challenge(s) to use
greenlock.renew = function(args) {
return greenlock._init().then(function() {
return manager.defaults().then(function(mconf) {
return greenlock._renew(mconf, args);
});
});
};
greenlock._renew = function(mconf, args) {
if (!args) {

View File

@ -187,14 +187,22 @@ P._normalizeChallenge = function(name, ch) {
};
P._loadSync = function(modname) {
var mod;
try {
return require(modname);
} catch (e) {
console.error("Could not load '%s'", modname);
console.error('Did you install it?');
console.error('\tnpm install --save %s', modname);
throw e;
}
/*
try {
mod = require(modname);
} catch (e) {
P._installSync(modname);
mod = require(modname);
}
return mod;
*/
};
P._installSync = function(moduleName) {