now handling cli option

This commit is contained in:
2016-03-14 04:32:52 +01:00
parent 55d7018891
commit 3ce49c7e97
13 changed files with 68 additions and 20 deletions

15
ts/npmts.assets.ts Normal file
View File

@ -0,0 +1,15 @@
/// <reference path="./typings/main.d.ts" />
import plugins = require("./npmts.plugins");
import paths = require("./npmts.paths");
export var run = function(configArg){
let done = plugins.Q.defer();
let config = configArg;
if(config.cli == true){
plugins.smartfile.copy(plugins.path.join(paths.npmtsAssetsDir,"cli.js"),paths.distDir);
done.resolve(config);
} else {
done.resolve(config);
}
return done.promise;
};

View File

@ -1,4 +1,4 @@
/// <reference path="./typings/main.d.ts" />
/// <reference path="./typings/main.d.ts" />
import plugins = require("./npmts.plugins");
import paths = require("./npmts.paths");
export var run = function(configArg){

View File

@ -43,10 +43,10 @@ var publishDocs = function(configArg){
if(plugins.smartenv.getEnv().isTravis && configArg.docs && configArg.docs.publish){
plugins.beautylog.log("now publishing docs to GitHub");
if (!plugins.shelljs.which('git')) {
plugins.beautylog.error('Git is not installed');
plugins.beautylog.error('Git is not installed!');
plugins.shelljs.exit(1);
} else if (plugins.shelljs.exec(deployScript).code !== 0) {
plugins.beautylog.error('Error: Git failed');
plugins.beautylog.error('Git failed!');
plugins.shelljs.exit(1);
}
plugins.beautylog.ok("JsDoc has been deployed to GitHub!");

View File

@ -9,6 +9,8 @@ paths.distDir = plugins.path.join(paths.cwd,"dist/");
paths.docsDir = plugins.path.join(paths.cwd,"docs/");
paths.testDir = plugins.path.join(paths.cwd,"test/");
paths.npmtsAssetsDir = plugins.path.join(__dirname,"../assets/");
//Files
paths.indexTS = plugins.path.join(paths.cwd,"ts/index.ts");
paths.testTS = plugins.path.join(paths.cwd,"ts/test.ts");

View File

@ -1,17 +1,21 @@
/// <reference path="./typings/main.d.ts" />
import plugins = require("./npmts.plugins");
import NpmtsConfigFile = require("./npmts.configfile");
import NpmtsOptions = require("./npmts.options");
import NpmtsInstall = require("./npmts.install");
import NpmtsAssets = require("./npmts.assets");
import NpmtsCompile = require("./npmts.compile");
import NpmtsConfigFile = require("./npmts.configfile");
import NpmtsInstall = require("./npmts.install");
import NpmtsJsdoc = require("./npmts.jsdoc");
import NpmtsOptions = require("./npmts.options");
import NpmtsTests = require("./npmts.tests");
export var run = function(){
var promisechain;
NpmtsConfigFile.run()
.then(NpmtsOptions.run)
.then(NpmtsInstall.run)
.then(NpmtsCompile.run)
.then(NpmtsAssets.run)
.then(NpmtsJsdoc.run)
.then(NpmtsTests.run)
.then(function(configArg){
@ -29,8 +33,11 @@ export var run = function(){
" wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww\n" +
" wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww\n" +
" wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww\n"
console.log(shipString);
plugins.beautylog.success("READY TO SHIP!");
if (process.env.CI){
console.log(shipString);
plugins.beautylog.success("READY TO SHIP!");
}
});
return promisechain;
};