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; | ||||
|     } | ||||
| 
 | ||||
|     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
 | ||||
|   le.register({ | ||||
|   return le.register({ | ||||
|     debug: args.debug | ||||
|   , email: args.email | ||||
|   , agreeTos: args.agreeTos | ||||
| @ -147,12 +147,12 @@ module.exports.run = function (args) { | ||||
|     ); | ||||
|     console.log(""); | ||||
| 
 | ||||
|     process.exit(0); | ||||
|     return 0; | ||||
|   }, function (err) { | ||||
|     console.error('[Error]: greenlock-cli'); | ||||
|     console.error(err.stack || new Error('get stack').stack); | ||||
| 
 | ||||
|     process.exit(1); | ||||
|     return 1; | ||||
|   }); | ||||
| 
 | ||||
| }; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user