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
|
|
|
|
2016-11-24 23:21:40 +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'
|
|
|
|
import * as NpmciEnv from './npmci.env'
|
2016-05-26 22:17:57 +02:00
|
|
|
|
2016-11-24 23:21:40 +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
|
|
|
|
smartcli.addCommand({
|
2016-11-24 23:21:40 +01:00
|
|
|
commandName: 'build'
|
2016-06-25 12:28:51 +02:00
|
|
|
}).then((argv) => {
|
|
|
|
build(argv._[1])
|
2016-11-24 23:21:40 +01:00
|
|
|
.then(NpmciEnv.configStore)
|
|
|
|
})
|
2016-06-25 11:58:33 +02:00
|
|
|
|
2016-06-26 04:54:10 +02:00
|
|
|
// clean
|
|
|
|
smartcli.addCommand({
|
2016-11-24 23:21:40 +01:00
|
|
|
commandName: 'clean'
|
2016-06-26 04:54:10 +02:00
|
|
|
}).then((argv) => {
|
|
|
|
clean()
|
2016-11-24 23:21:40 +01:00
|
|
|
.then(NpmciEnv.configStore)
|
|
|
|
})
|
2016-06-26 04:54:10 +02:00
|
|
|
|
2016-06-25 12:28:51 +02:00
|
|
|
// command
|
|
|
|
smartcli.addCommand({
|
2016-11-24 23:21:40 +01:00
|
|
|
commandName: 'command'
|
2016-06-25 12:28:51 +02:00
|
|
|
}).then((argv) => {
|
|
|
|
command()
|
2016-11-24 23:21:40 +01:00
|
|
|
.then(NpmciEnv.configStore)
|
|
|
|
})
|
2016-05-29 22:54:59 +02:00
|
|
|
|
2016-06-25 12:28:51 +02:00
|
|
|
// install
|
|
|
|
smartcli.addCommand({
|
2016-11-24 23:21:40 +01:00
|
|
|
commandName: 'install'
|
2016-06-25 12:28:51 +02:00
|
|
|
}).then((argv) => {
|
|
|
|
install(argv._[1])
|
2016-11-24 23:21:40 +01:00
|
|
|
.then(NpmciEnv.configStore)
|
|
|
|
})
|
2016-05-29 22:54:59 +02:00
|
|
|
|
2016-06-25 12:28:51 +02:00
|
|
|
// prepare
|
|
|
|
smartcli.addCommand({
|
2016-11-24 23:21:40 +01:00
|
|
|
commandName: 'prepare'
|
2016-06-25 12:28:51 +02:00
|
|
|
}).then((argv) => {
|
|
|
|
prepare(argv._[1])
|
2016-11-24 23:21:40 +01:00
|
|
|
.then(NpmciEnv.configStore)
|
|
|
|
})
|
2016-06-25 12:28:51 +02:00
|
|
|
|
|
|
|
// publish
|
|
|
|
smartcli.addCommand({
|
2016-11-24 23:21:40 +01:00
|
|
|
commandName: 'publish'
|
2016-06-25 12:28:51 +02:00
|
|
|
}).then((argv) => {
|
|
|
|
publish(argv._[1])
|
2016-11-24 23:21:40 +01:00
|
|
|
.then(NpmciEnv.configStore)
|
|
|
|
})
|
2016-06-25 12:28:51 +02:00
|
|
|
|
|
|
|
// test
|
|
|
|
smartcli.addCommand({
|
2016-11-24 23:21:40 +01:00
|
|
|
commandName: 'test'
|
2016-06-25 12:28:51 +02:00
|
|
|
}).then((argv) => {
|
|
|
|
test(argv._[1])
|
2016-11-24 23:21:40 +01:00
|
|
|
.then(NpmciEnv.configStore)
|
|
|
|
})
|
2016-06-25 12:28:51 +02:00
|
|
|
|
|
|
|
// trigger
|
|
|
|
smartcli.addCommand({
|
2016-11-24 23:21:40 +01:00
|
|
|
commandName: 'trigger'
|
2016-06-25 12:28:51 +02:00
|
|
|
}).then((argv) => {
|
2016-11-24 23:21:40 +01:00
|
|
|
trigger()
|
|
|
|
})
|
2016-06-25 12:28:51 +02:00
|
|
|
|
2016-11-24 23:21:40 +01:00
|
|
|
smartcli.startParse()
|