mirror of
				https://git.coolaj86.com/coolaj86/greenlock-cli.js
				synced 2025-11-04 11:02:47 +00:00 
			
		
		
		
	stubs
This commit is contained in:
		
							parent
							
								
									4b6dff174e
								
							
						
					
					
						commit
						23b74e0609
					
				@ -27,7 +27,49 @@ cli.parse({
 | 
				
			|||||||
, 'logs-dir': [ false, "(ignored)", 'string', '~/letsencrypt/var/log/' ]
 | 
					, 'logs-dir': [ false, "(ignored)", 'string', '~/letsencrypt/var/log/' ]
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
cli.main(function(args, options) {
 | 
					// ignore certonly and extraneous arguments
 | 
				
			||||||
  console.log(args);
 | 
					cli.main(function(_, options) {
 | 
				
			||||||
  console.log(options);
 | 
					  var args = {};
 | 
				
			||||||
 | 
					  var homedir = require('homedir')(); 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Object.keys(options).forEach(function (key) {
 | 
				
			||||||
 | 
					    var val = options[key];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if ('string' === typeof val) {
 | 
				
			||||||
 | 
					      val = val.replace(/^~/, homedir);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    key = key.replace(/\-([a-z0-9A-Z])/g, function (c) { return c[1].toUpperCase(); });
 | 
				
			||||||
 | 
					    args[key] = val;
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Object.keys(args).forEach(function (key) {
 | 
				
			||||||
 | 
					    var val = args[key];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if ('string' === typeof val) {
 | 
				
			||||||
 | 
					      val = val.replace(/\:conf/, args.configDir);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    args[key] = val;
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  var LE = require('letsencrypt');
 | 
				
			||||||
 | 
					  var handlers;
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					  if (args.standalone) {
 | 
				
			||||||
 | 
					    handlers = require('../lib/standalone');
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  else if (args.webrootPath) {
 | 
				
			||||||
 | 
					    handlers = require('../lib/webroot');
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  LE.create({}, handlers).register(args, function (err, results) {
 | 
				
			||||||
 | 
					    if (err) {
 | 
				
			||||||
 | 
					      console.error(err.stack);
 | 
				
			||||||
 | 
					      return;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // should get back account, path to certs, pems, etc?
 | 
				
			||||||
 | 
					    console.log(results);
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										0
									
								
								lib/standalone.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								lib/standalone.js
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								lib/webroot.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								lib/webroot.js
									
									
									
									
									
										Normal file
									
								
							@ -33,6 +33,7 @@
 | 
				
			|||||||
  },
 | 
					  },
 | 
				
			||||||
  "homepage": "https://github.com/Daplie/node-letsencrypt-cli",
 | 
					  "homepage": "https://github.com/Daplie/node-letsencrypt-cli",
 | 
				
			||||||
  "dependencies": {
 | 
					  "dependencies": {
 | 
				
			||||||
    "cli": "^0.11.1"
 | 
					    "cli": "^0.11.1",
 | 
				
			||||||
 | 
					    "homedir": "^0.6.0"
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user