now has working version
This commit is contained in:
		
							
								
								
									
										10
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										10
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @@ -7,7 +7,8 @@ | |||||||
|     "npmci": "dist/index.js" |     "npmci": "dist/index.js" | ||||||
|   }, |   }, | ||||||
|   "scripts": { |   "scripts": { | ||||||
|     "test": "(npmts)" |     "test": "(npmts) && (npm run testVersion)", | ||||||
|  |     "testVersion":"node dist/index.js -v" | ||||||
|   }, |   }, | ||||||
|   "repository": { |   "repository": { | ||||||
|     "type": "git", |     "type": "git", | ||||||
|   | |||||||
| @@ -22,8 +22,8 @@ export {publish} from "./npmci.publish"; | |||||||
| let command; | let command; | ||||||
| let commandOption:string; | let commandOption:string; | ||||||
|  |  | ||||||
| plugins.commander | let commander = plugins.commander | ||||||
|     .version(npmciInfo.version) |     .option("-v","--version","print version") | ||||||
|     .arguments('<commandarg> [commandoptionarg]') |     .arguments('<commandarg> [commandoptionarg]') | ||||||
|     .action(function (commandarg, commandoptionarg) { |     .action(function (commandarg, commandoptionarg) { | ||||||
|         command = commandarg; |         command = commandarg; | ||||||
| @@ -32,6 +32,11 @@ plugins.commander | |||||||
|   |   | ||||||
| plugins.commander.parse(process.argv); | plugins.commander.parse(process.argv); | ||||||
|  |  | ||||||
|  | if(commander.version) { | ||||||
|  |     console.log(npmciInfo.version); | ||||||
|  |     process.exit(0); | ||||||
|  | } | ||||||
|  |  | ||||||
| if (typeof command === 'undefined') { | if (typeof command === 'undefined') { | ||||||
|     console.error('no command given!'); |     console.error('no command given!'); | ||||||
|     process.exit(1); |     process.exit(1); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user