npmci/ts/index.ts

81 lines
1.8 KiB
TypeScript
Raw Normal View History

2016-05-26 20:17:57 +00:00
#!/usr/bin/env node
2016-05-29 20:54:59 +00:00
import "typings-global";
import * as plugins from "./npmci.plugins";
2016-06-09 01:42:12 +00:00
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-06-02 23:58:37 +00:00
import {build} from "./npmci.build"
2016-06-25 10:28:51 +00:00
import {command} from "./npmci.command";
2016-05-30 00:28:47 +00:00
import {install} from "./npmci.install";
import {publish} from "./npmci.publish";
2016-06-02 11:08:15 +00:00
import {prepare} from "./npmci.prepare";
import {tag, retag} from "./npmci.tag";
2016-06-02 23:58:37 +00:00
import {test} from "./npmci.test";
2016-06-01 04:30:21 +00:00
import {trigger} from "./npmci.trigger";
2016-06-07 10:36:00 +00:00
import * as NpmciEnv from "./npmci.env";
2016-05-26 20:17:57 +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-06-25 10:28:51 +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({
commandName:"build"
}).then((argv) => {
build(argv._[1])
.then(NpmciEnv.configStore);
});
2016-06-25 09:58:33 +00:00
2016-06-25 10:28:51 +00:00
// command
smartcli.addCommand({
commandName:"command"
}).then((argv) => {
command()
.then(NpmciEnv.configStore);
});
2016-05-29 20:54:59 +00:00
2016-06-25 10:28:51 +00:00
// install
smartcli.addCommand({
commandName:"install"
}).then((argv) => {
install(argv._[1])
.then(NpmciEnv.configStore);
});
2016-05-29 20:54:59 +00:00
2016-06-25 10:28:51 +00:00
// prepare
smartcli.addCommand({
commandName:"prepare"
}).then((argv) => {
prepare(argv._[1])
.then(NpmciEnv.configStore);
});
// publish
smartcli.addCommand({
commandName:"publish"
}).then((argv) => {
publish(argv._[1])
.then(NpmciEnv.configStore);
});
// test
smartcli.addCommand({
commandName:"test"
}).then((argv) => {
test(argv._[1])
.then(NpmciEnv.configStore);
});
// trigger
smartcli.addCommand({
commandName:"trigger"
}).then((argv) => {
trigger();
});
smartcli.startParse();