moved cli into its own file
This commit is contained in:
16
ts/index.ts
16
ts/index.ts
@ -6,19 +6,9 @@
|
||||
import * as early from 'early'
|
||||
early.start('NPMTS')
|
||||
import * as plugins from './npmts.plugins'
|
||||
import * as paths from './npmts.paths'
|
||||
import * as promisechain from './npmts.promisechain'
|
||||
import * as cli from './npmts.cli'
|
||||
early.stop()
|
||||
.then(() => {
|
||||
let npmtsProjectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.npmtsPackageRoot)
|
||||
let npmtsCli = new plugins.smartcli.Smartcli()
|
||||
npmtsCli.standardTask()
|
||||
.then((argvArg) => {
|
||||
plugins.beautylog.figletSync('NPMTS')
|
||||
plugins.beautylog.info('npmts version: ' + npmtsProjectInfo.version)
|
||||
promisechain.run(argvArg).catch((err) => { console.log(err) })
|
||||
})
|
||||
|
||||
npmtsCli.addVersion(npmtsProjectInfo.version)
|
||||
npmtsCli.startParse()
|
||||
let loaded = plugins // to make sure plugins get actually loaded
|
||||
cli.run()
|
||||
})
|
||||
|
19
ts/npmts.cli.ts
Normal file
19
ts/npmts.cli.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import * as plugins from './npmts.plugins'
|
||||
import * as paths from './npmts.paths'
|
||||
import * as promisechain from './npmts.promisechain'
|
||||
import * as q from 'q'
|
||||
|
||||
export let run = () => {
|
||||
let done = q.defer()
|
||||
let npmtsProjectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.npmtsPackageRoot)
|
||||
let npmtsCli = new plugins.smartcli.Smartcli()
|
||||
npmtsCli.standardTask()
|
||||
.then((argvArg) => {
|
||||
plugins.beautylog.figletSync('NPMTS')
|
||||
plugins.beautylog.info('npmts version: ' + npmtsProjectInfo.version)
|
||||
promisechain.run(argvArg).catch((err) => { console.log(err) })
|
||||
})
|
||||
npmtsCli.addVersion(npmtsProjectInfo.version)
|
||||
npmtsCli.startParse()
|
||||
return done.promise
|
||||
}
|
Reference in New Issue
Block a user