moved cli into its own file
This commit is contained in:
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;
|
||||
};
|
Reference in New Issue
Block a user