now stating npmts version
This commit is contained in:
@ -1,11 +1,16 @@
|
||||
import "typings-global";
|
||||
|
||||
// start early and load modules
|
||||
import * as early from "early";
|
||||
early.start("NPMTS");
|
||||
import * as plugins from "./npmts.plugins"
|
||||
import * as paths from "./npmts.paths";
|
||||
import {promisechain} from "./npmts.promisechain";
|
||||
early.stop();
|
||||
|
||||
plugins.beautylog.figletSync("NPMTS");
|
||||
let projectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.npmtsPackageRoot);
|
||||
plugins.beautylog.info("npmts version: " + projectInfo.version);
|
||||
|
||||
try {
|
||||
promisechain();
|
||||
|
@ -21,41 +21,6 @@ let genJsdoc = function(configArg){
|
||||
return done.promise;
|
||||
};
|
||||
|
||||
export let publishDocs = function(configArg){
|
||||
let done = plugins.Q.defer();
|
||||
let gitUrl = plugins.projectinfo.npm(
|
||||
paths.cwd,
|
||||
{
|
||||
gitAccessToken:process.env.GITHUB_TOKEN
|
||||
}
|
||||
).git.httpsUrl;
|
||||
|
||||
let deployScript = ""
|
||||
+ "cd " + paths.docsDir + " "
|
||||
+ "&& git init " + "> /dev/null 2>&1 "
|
||||
+ "&& git config user.name \"TRAVIS CI\" " + "> /dev/null 2>&1 "
|
||||
+ "&& git config user.email \"travis@shipzone.io\" " + "> /dev/null 2>&1 "
|
||||
+ "&& git add . " + "> /dev/null 2>&1 "
|
||||
+ "&& git commit -m \"Deploy to GitHub Pages\" " + "> /dev/null 2>&1 "
|
||||
+ "&& git push --force --quiet "
|
||||
+ "\"" + gitUrl + "\" "
|
||||
+ "master:gh-pages " + "> /dev/null 2>&1";
|
||||
|
||||
|
||||
plugins.beautylog.log("now publishing JsDoc documentation to GitHub");
|
||||
if (!plugins.shelljs.which('git')) {
|
||||
plugins.beautylog.error('Git is not installed!');
|
||||
plugins.shelljs.exit(1);
|
||||
} else if (plugins.shelljs.exec(deployScript).code !== 0) {
|
||||
plugins.beautylog.error('Git failed!');
|
||||
plugins.shelljs.exit(1);
|
||||
}
|
||||
plugins.beautylog.ok("JsDoc documentation has been deployed to GitHub!");
|
||||
done.resolve(configArg);
|
||||
|
||||
return done.promise;
|
||||
};
|
||||
|
||||
|
||||
export let run = function(configArg){
|
||||
let done = plugins.Q.defer();
|
||||
|
@ -1,6 +1,11 @@
|
||||
import "typings-global";
|
||||
import plugins = require("./npmts.plugins");
|
||||
|
||||
//Npmts Paths
|
||||
export let npmtsPackageRoot = plugins.path.join(__dirname,"../");
|
||||
|
||||
|
||||
//Project paths
|
||||
export let cwd = plugins.smartcli.get.cwd().path;
|
||||
|
||||
//Directories
|
||||
|
@ -15,15 +15,15 @@ export let g = {
|
||||
};
|
||||
export let lodashObject = require('lodash/fp/object');
|
||||
export let merge2 = require("merge2");
|
||||
export let projectinfo = require("projectinfo");
|
||||
export import projectinfo = require("projectinfo");
|
||||
export let path = require("path");
|
||||
export let Q = require("q");
|
||||
export let shelljs = require("shelljs");
|
||||
export let smartci = require("smartci");
|
||||
export let smartcli = require("smartcli");
|
||||
export let smartcov = require("smartcov");
|
||||
export let smartenv = require("smartenv");
|
||||
export let smartfile = require("smartfile");
|
||||
export import smartenv = require("smartenv");
|
||||
export import smartfile = require("smartfile");
|
||||
export import smartpath = require("smartpath");
|
||||
export import smartstring = require("smartstring");
|
||||
export let sourceMapSupport = require("source-map-support").install(); // this is required to display errors correctly during testing
|
@ -6,10 +6,6 @@ import NpmtsJsdoc = require("./npmts.jsdoc");
|
||||
export let run = function(configArg){
|
||||
let done = plugins.Q.defer();
|
||||
let config = configArg;
|
||||
let promiseArray = [];
|
||||
config.docs.publish ? promiseArray.push(NpmtsJsdoc.publishDocs(configArg)) : void(0);
|
||||
promiseArray.length === 0 ? plugins.beautylog.info("Did not publish anything!") : void(0);
|
||||
|
||||
plugins.Q.all(promiseArray).then(done.resolve);
|
||||
done.resolve();
|
||||
return done.promise;
|
||||
};
|
Reference in New Issue
Block a user