npmci/ts/index.ts

87 lines
1.8 KiB
TypeScript
Raw Permalink Normal View History

2016-11-24 22:21:40 +00: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 01:11:13 +00:00
2016-11-24 22:21:40 +00: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 20:17:57 +00:00
2016-11-24 22:21:40 +00:00
export {build} from './npmci.build'
export {install} from './npmci.install';
export {publish} from './npmci.publish';
2016-05-29 20:54:59 +00:00
2016-11-24 22:21:40 +00:00
let smartcli = new plugins.smartcli.Smartcli()
smartcli.addVersion(npmciInfo.version)
2016-06-25 09:58:33 +00:00
2016-06-25 10:28:51 +00:00
// build
smartcli.addCommand({
2016-11-24 22:21:40 +00:00
commandName: 'build'
2016-06-25 10:28:51 +00:00
}).then((argv) => {
build(argv._[1])
2016-11-24 22:21:40 +00:00
.then(NpmciEnv.configStore)
})
2016-06-25 09:58:33 +00:00
2016-06-26 02:54:10 +00:00
// clean
smartcli.addCommand({
2016-11-24 22:21:40 +00:00
commandName: 'clean'
2016-06-26 02:54:10 +00:00
}).then((argv) => {
clean()
2016-11-24 22:21:40 +00:00
.then(NpmciEnv.configStore)
})
2016-06-26 02:54:10 +00:00
2016-06-25 10:28:51 +00:00
// command
smartcli.addCommand({
2016-11-24 22:21:40 +00:00
commandName: 'command'
2016-06-25 10:28:51 +00:00
}).then((argv) => {
command()
2016-11-24 22:21:40 +00:00
.then(NpmciEnv.configStore)
})
2016-05-29 20:54:59 +00:00
2016-06-25 10:28:51 +00:00
// install
smartcli.addCommand({
2016-11-24 22:21:40 +00:00
commandName: 'install'
2016-06-25 10:28:51 +00:00
}).then((argv) => {
install(argv._[1])
2016-11-24 22:21:40 +00:00
.then(NpmciEnv.configStore)
})
2016-05-29 20:54:59 +00:00
2016-06-25 10:28:51 +00:00
// prepare
smartcli.addCommand({
2016-11-24 22:21:40 +00:00
commandName: 'prepare'
2016-06-25 10:28:51 +00:00
}).then((argv) => {
prepare(argv._[1])
2016-11-24 22:21:40 +00:00
.then(NpmciEnv.configStore)
})
2016-06-25 10:28:51 +00:00
// publish
smartcli.addCommand({
2016-11-24 22:21:40 +00:00
commandName: 'publish'
2016-06-25 10:28:51 +00:00
}).then((argv) => {
publish(argv._[1])
2016-11-24 22:21:40 +00:00
.then(NpmciEnv.configStore)
})
2016-06-25 10:28:51 +00:00
// test
smartcli.addCommand({
2016-11-24 22:21:40 +00:00
commandName: 'test'
2016-06-25 10:28:51 +00:00
}).then((argv) => {
test(argv._[1])
2016-11-24 22:21:40 +00:00
.then(NpmciEnv.configStore)
})
2016-06-25 10:28:51 +00:00
// trigger
smartcli.addCommand({
2016-11-24 22:21:40 +00:00
commandName: 'trigger'
2016-06-25 10:28:51 +00:00
}).then((argv) => {
2016-11-24 22:21:40 +00:00
trigger()
})
2016-06-25 10:28:51 +00:00
2016-11-24 22:21:40 +00:00
smartcli.startParse()