moved cli into its own file
This commit is contained in:
parent
d7b08034da
commit
69742fd6a7
@ -1,2 +1,2 @@
|
||||
#!/usr/bin/env node
|
||||
var index = require("../dist/index.js");
|
||||
var index = require("../dist/index.js");
|
||||
|
2
dist/cli.js
vendored
2
dist/cli.js
vendored
@ -1,2 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
var index = require("../{{pathToIndex}}");
|
15
dist/index.js
vendored
15
dist/index.js
vendored
@ -6,18 +6,9 @@
|
||||
const early = require("early");
|
||||
early.start('NPMTS');
|
||||
const plugins = require("./npmts.plugins");
|
||||
const paths = require("./npmts.paths");
|
||||
const promisechain = require("./npmts.promisechain");
|
||||
const cli = require("./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();
|
||||
});
|
||||
|
3
dist/npmts.cli.d.ts
vendored
Normal file
3
dist/npmts.cli.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
/// <reference types="q" />
|
||||
import * as q from 'q';
|
||||
export declare let run: () => q.Promise<{}>;
|
19
dist/npmts.cli.js
vendored
Normal file
19
dist/npmts.cli.js
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
const plugins = require("./npmts.plugins");
|
||||
const paths = require("./npmts.paths");
|
||||
const promisechain = require("./npmts.promisechain");
|
||||
const q = require("q");
|
||||
exports.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;
|
||||
};
|
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
|
||||
}
|
Loading…
Reference in New Issue
Block a user