| 
									
										
										
										
											2016-11-24 23:21:40 +01:00
										 |  |  | import * as plugins from './npmci.plugins' | 
					
						
							|  |  |  | import * as paths from './npmci.paths' | 
					
						
							|  |  |  | let npmciInfo = new plugins.projectinfo.ProjectinfoNpm(paths.NpmciPackageRoot) | 
					
						
							|  |  |  | plugins.beautylog.log('npmci version: ' + npmciInfo.version) | 
					
						
							| 
									
										
										
										
											2016-05-30 03:11:13 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 14:46:05 +01:00
										 |  |  | import { build } from './npmci.build' | 
					
						
							|  |  |  | import { clean } from './npmci.clean' | 
					
						
							|  |  |  | import { command } from './npmci.command' | 
					
						
							|  |  |  | import { install } from './npmci.install' | 
					
						
							|  |  |  | import { publish } from './npmci.publish' | 
					
						
							|  |  |  | import { prepare } from './npmci.prepare' | 
					
						
							|  |  |  | import { test } from './npmci.test' | 
					
						
							|  |  |  | import { trigger } from './npmci.trigger' | 
					
						
							| 
									
										
										
										
											2016-11-24 23:21:40 +01:00
										 |  |  | import * as NpmciEnv from './npmci.env' | 
					
						
							| 
									
										
										
										
											2016-05-26 22:17:57 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-19 14:46:05 +01:00
										 |  |  | export { build } from './npmci.build' | 
					
						
							|  |  |  | export { install } from './npmci.install'; | 
					
						
							|  |  |  | export { publish } from './npmci.publish'; | 
					
						
							| 
									
										
										
										
											2016-05-29 22:54:59 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-24 23:21:40 +01:00
										 |  |  | let smartcli = new plugins.smartcli.Smartcli() | 
					
						
							|  |  |  | smartcli.addVersion(npmciInfo.version) | 
					
						
							| 
									
										
										
										
											2016-06-25 11:58:33 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-25 12:28:51 +02:00
										 |  |  | // build
 | 
					
						
							| 
									
										
										
										
											2017-02-19 14:46:05 +01:00
										 |  |  | smartcli.addCommand('build') | 
					
						
							|  |  |  |   .then((argv) => { | 
					
						
							|  |  |  |     build(argv._[ 1 ]) | 
					
						
							|  |  |  |       .then(NpmciEnv.configStore) | 
					
						
							| 
									
										
										
										
											2017-05-15 18:10:24 +02:00
										 |  |  |       .catch(err => { | 
					
						
							|  |  |  |         console.log(err) | 
					
						
							| 
									
										
										
										
											2017-05-15 18:27:13 +02:00
										 |  |  |         process.exit(1) | 
					
						
							| 
									
										
										
										
											2017-05-15 18:10:24 +02:00
										 |  |  |       }) | 
					
						
							| 
									
										
										
										
											2017-02-19 14:46:05 +01:00
										 |  |  |   }) | 
					
						
							| 
									
										
										
										
											2016-06-25 11:58:33 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-26 04:54:10 +02:00
										 |  |  | // clean
 | 
					
						
							| 
									
										
										
										
											2017-02-19 14:46:05 +01:00
										 |  |  | smartcli.addCommand('clean') | 
					
						
							|  |  |  |   .then((argv) => { | 
					
						
							| 
									
										
										
										
											2016-06-26 04:54:10 +02:00
										 |  |  |     clean() | 
					
						
							| 
									
										
										
										
											2017-02-19 14:46:05 +01:00
										 |  |  |       .then(NpmciEnv.configStore) | 
					
						
							| 
									
										
										
										
											2017-05-15 18:27:13 +02:00
										 |  |  |       .catch(err => { | 
					
						
							|  |  |  |         console.log(err) | 
					
						
							|  |  |  |         process.exit(1) | 
					
						
							|  |  |  |       }) | 
					
						
							| 
									
										
										
										
											2017-02-19 14:46:05 +01:00
										 |  |  |   }) | 
					
						
							| 
									
										
										
										
											2016-06-26 04:54:10 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-25 12:28:51 +02:00
										 |  |  | // command
 | 
					
						
							| 
									
										
										
										
											2017-02-19 14:46:05 +01:00
										 |  |  | smartcli.addCommand('command') | 
					
						
							|  |  |  |   .then((argv) => { | 
					
						
							| 
									
										
										
										
											2016-06-25 12:28:51 +02:00
										 |  |  |     command() | 
					
						
							| 
									
										
										
										
											2017-02-19 14:46:05 +01:00
										 |  |  |       .then(NpmciEnv.configStore) | 
					
						
							| 
									
										
										
										
											2017-05-15 18:27:13 +02:00
										 |  |  |       .catch(err => { | 
					
						
							|  |  |  |         console.log(err) | 
					
						
							|  |  |  |         process.exit(1) | 
					
						
							|  |  |  |       }) | 
					
						
							| 
									
										
										
										
											2017-02-19 14:46:05 +01:00
										 |  |  |   }) | 
					
						
							| 
									
										
										
										
											2016-05-29 22:54:59 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-25 12:28:51 +02:00
										 |  |  | // install
 | 
					
						
							| 
									
										
										
										
											2017-02-19 14:46:05 +01:00
										 |  |  | smartcli.addCommand('install') | 
					
						
							|  |  |  |   .then((argv) => { | 
					
						
							|  |  |  |     install(argv._[ 1 ]) | 
					
						
							|  |  |  |       .then(NpmciEnv.configStore) | 
					
						
							| 
									
										
										
										
											2017-05-15 18:27:13 +02:00
										 |  |  |       .catch(err => { | 
					
						
							|  |  |  |         console.log(err) | 
					
						
							|  |  |  |         process.exit(1) | 
					
						
							|  |  |  |       }) | 
					
						
							| 
									
										
										
										
											2017-02-19 14:46:05 +01:00
										 |  |  |   }) | 
					
						
							| 
									
										
										
										
											2016-05-29 22:54:59 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-25 12:28:51 +02:00
										 |  |  | // prepare
 | 
					
						
							| 
									
										
										
										
											2017-02-19 14:46:05 +01:00
										 |  |  | smartcli.addCommand('prepare') | 
					
						
							|  |  |  |   .then((argv) => { | 
					
						
							|  |  |  |     prepare(argv._[ 1 ]) | 
					
						
							|  |  |  |       .then(NpmciEnv.configStore) | 
					
						
							| 
									
										
										
										
											2017-05-15 18:27:13 +02:00
										 |  |  |       .catch(err => { | 
					
						
							|  |  |  |         console.log(err) | 
					
						
							|  |  |  |         process.exit(1) | 
					
						
							|  |  |  |       }) | 
					
						
							| 
									
										
										
										
											2017-02-19 14:46:05 +01:00
										 |  |  |   }) | 
					
						
							| 
									
										
										
										
											2016-06-25 12:28:51 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | // publish
 | 
					
						
							| 
									
										
										
										
											2017-02-19 14:46:05 +01:00
										 |  |  | smartcli.addCommand('publish') | 
					
						
							|  |  |  |   .then((argv) => { | 
					
						
							|  |  |  |     publish(argv._[ 1 ]) | 
					
						
							|  |  |  |       .then(NpmciEnv.configStore) | 
					
						
							| 
									
										
										
										
											2017-05-15 18:27:13 +02:00
										 |  |  |       .catch(err => { | 
					
						
							|  |  |  |         console.log(err) | 
					
						
							|  |  |  |         process.exit(1) | 
					
						
							|  |  |  |       }) | 
					
						
							| 
									
										
										
										
											2017-02-19 14:46:05 +01:00
										 |  |  |   }) | 
					
						
							| 
									
										
										
										
											2016-06-25 12:28:51 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | // test
 | 
					
						
							| 
									
										
										
										
											2017-02-19 14:46:05 +01:00
										 |  |  | smartcli.addCommand('test') | 
					
						
							|  |  |  |   .then((argv) => { | 
					
						
							|  |  |  |     test(argv._[ 1 ]) | 
					
						
							|  |  |  |       .then(NpmciEnv.configStore) | 
					
						
							| 
									
										
										
										
											2017-05-15 18:27:13 +02:00
										 |  |  |       .catch(err => { | 
					
						
							|  |  |  |         console.log(err) | 
					
						
							|  |  |  |         process.exit(1) | 
					
						
							|  |  |  |       }) | 
					
						
							| 
									
										
										
										
											2017-02-19 14:46:05 +01:00
										 |  |  |   }) | 
					
						
							| 
									
										
										
										
											2016-06-25 12:28:51 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | // trigger
 | 
					
						
							| 
									
										
										
										
											2017-02-19 14:46:05 +01:00
										 |  |  | smartcli.addCommand('trigger') | 
					
						
							|  |  |  |   .then((argv) => { | 
					
						
							| 
									
										
										
										
											2016-11-24 23:21:40 +01:00
										 |  |  |     trigger() | 
					
						
							| 
									
										
										
										
											2017-02-19 14:46:05 +01:00
										 |  |  |   }) | 
					
						
							| 
									
										
										
										
											2016-06-25 12:28:51 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-24 23:21:40 +01:00
										 |  |  | smartcli.startParse() |