mirror of
				https://git.coolaj86.com/coolaj86/greenlock-cli.js
				synced 2025-11-04 11:02:47 +00:00 
			
		
		
		
	Changed index.js to return a Promise that resolves to the status to return on the command line, which greenlock.js now uses when closing the process.
This commit is contained in:
		
							parent
							
								
									9bbb3ea6b0
								
							
						
					
					
						commit
						248640cd3e
					
				@ -103,6 +103,8 @@ cli.main(function(_, options) {
 | 
				
			|||||||
      return;
 | 
					      return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    require('../').run(args);
 | 
					    require('../').run(args).then(function (status) {
 | 
				
			||||||
 | 
					      process.exit(status);
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										6
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								index.js
									
									
									
									
									
								
							@ -98,7 +98,7 @@ module.exports.run = function (args) {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Note: can't use args directly as null values will overwrite template values
 | 
					  // Note: can't use args directly as null values will overwrite template values
 | 
				
			||||||
  le.register({
 | 
					  return le.register({
 | 
				
			||||||
    debug: args.debug
 | 
					    debug: args.debug
 | 
				
			||||||
  , email: args.email
 | 
					  , email: args.email
 | 
				
			||||||
  , agreeTos: args.agreeTos
 | 
					  , agreeTos: args.agreeTos
 | 
				
			||||||
@ -147,12 +147,12 @@ module.exports.run = function (args) {
 | 
				
			|||||||
    );
 | 
					    );
 | 
				
			||||||
    console.log("");
 | 
					    console.log("");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    process.exit(0);
 | 
					    return 0;
 | 
				
			||||||
  }, function (err) {
 | 
					  }, function (err) {
 | 
				
			||||||
    console.error('[Error]: greenlock-cli');
 | 
					    console.error('[Error]: greenlock-cli');
 | 
				
			||||||
    console.error(err.stack || new Error('get stack').stack);
 | 
					    console.error(err.stack || new Error('get stack').stack);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    process.exit(1);
 | 
					    return 1;
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user