Add dry option
This commit is contained in:
		
							parent
							
								
									ed42a69488
								
							
						
					
					
						commit
						6d1a320445
					
				
							
								
								
									
										12
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								index.js
									
									
									
									
									
								
							| @ -37,6 +37,11 @@ const argv = yargs(hideBin(process.argv)) | |||||||
|     alias: 'e', |     alias: 'e', | ||||||
|     description: 'Include reviews for PRs merged before this date', |     description: 'Include reviews for PRs merged before this date', | ||||||
|   }) |   }) | ||||||
|  |   .option('dry', { | ||||||
|  |     alias: 'd', | ||||||
|  |     type: 'boolean', | ||||||
|  |     description: 'Only list contribution details without creating them', | ||||||
|  |   }) | ||||||
|   .help() |   .help() | ||||||
|   .version() |   .version() | ||||||
|   .demandOption('start', 'Please provide a start date') |   .demandOption('start', 'Please provide a start date') | ||||||
| @ -182,8 +187,11 @@ Promise.all([ | |||||||
| 
 | 
 | ||||||
|   generateContributionData(reviews, kredits.Contributor).then( |   generateContributionData(reviews, kredits.Contributor).then( | ||||||
|     (contributionData) => { |     (contributionData) => { | ||||||
|       console.log('contributions:'); |       if (argv.dry) { | ||||||
|       console.log(util.inspect(contributionData, { depth: 3, colors: true })); |         console.log('contributions:'); | ||||||
|  |         console.log(util.inspect(contributionData, { depth: 3, colors: true })); | ||||||
|  |         return; | ||||||
|  |       } | ||||||
|     } |     } | ||||||
|   ); |   ); | ||||||
| }); | }); | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user