diff --git a/dist/npmts.jsdoc.js b/dist/npmts.jsdoc.js
index b0cc7d7..c3e7f62 100644
--- a/dist/npmts.jsdoc.js
+++ b/dist/npmts.jsdoc.js
@@ -19,7 +19,7 @@ var genJsdoc = function (configArg) {
}));
return done.promise;
};
-var publishDocs = function (configArg) {
+exports.publishDocs = function (configArg) {
var done = plugins.Q.defer();
var gitUrl = plugins.projectinfo.npm(paths.cwd, {
gitAccessToken: process.env.GITHUB_TOKEN
@@ -48,6 +48,7 @@ var publishDocs = function (configArg) {
done.resolve(configArg);
}
else {
+ console.log("GitHub documentation has not been uploaded.");
done.resolve(configArg);
}
return done.promise;
@@ -55,7 +56,6 @@ var publishDocs = function (configArg) {
exports.run = function (configArg) {
var done = plugins.Q.defer();
genJsdoc(configArg)
- .then(publishDocs)
.then(done.resolve);
return done.promise;
};
diff --git a/dist/npmts.options.js b/dist/npmts.options.js
index d5f29e7..156fdfa 100644
--- a/dist/npmts.options.js
+++ b/dist/npmts.options.js
@@ -7,7 +7,7 @@ exports.isRelease = function () {
};
exports.doPublish = function () {
return exports.isRelease()
- && plugins.smartci.get.subJobNumber() != 1;
+ && plugins.smartci.get.subJobNumber() == 1;
};
exports.run = function (configArg) {
var done = plugins.Q.defer();
diff --git a/dist/npmts.promisechain.js b/dist/npmts.promisechain.js
index 024592a..84a541e 100644
--- a/dist/npmts.promisechain.js
+++ b/dist/npmts.promisechain.js
@@ -8,6 +8,7 @@ var NpmtsConfigFile = require("./npmts.configfile");
var NpmtsInstall = require("./npmts.install");
var NpmtsJsdoc = require("./npmts.jsdoc");
var NpmtsOptions = require("./npmts.options");
+var NpmtsPublish = require("./npmts.publish");
var NpmtsTests = require("./npmts.tests");
exports.run = function () {
var promisechain;
@@ -19,6 +20,7 @@ exports.run = function () {
.then(NpmtsAssets.run)
.then(NpmtsJsdoc.run)
.then(NpmtsTests.run)
+ .then(NpmtsPublish.run)
.then(function (configArg) {
var shipString = "" +
"\n" +
diff --git a/dist/npmts.publish.js b/dist/npmts.publish.js
new file mode 100644
index 0000000..09a2c4e
--- /dev/null
+++ b/dist/npmts.publish.js
@@ -0,0 +1,15 @@
+"use strict";
+///
+var plugins = require("./npmts.plugins");
+var NpmtsTests = require("./npmts.tests");
+var NpmtsJsdoc = require("./npmts.jsdoc");
+exports.run = function (configArg) {
+ var done = plugins.Q.defer();
+ var config = configArg;
+ var promiseArray = [];
+ config.coveralls ? promiseArray.push(NpmtsTests.publishCoverage(configArg)) : void (0);
+ 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());
+ return done.promise;
+};
diff --git a/dist/npmts.tests.js b/dist/npmts.tests.js
index a10a44a..6b48a7d 100644
--- a/dist/npmts.tests.js
+++ b/dist/npmts.tests.js
@@ -2,6 +2,24 @@
///
var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths");
+exports.publishCoverage = function (configArg) {
+ var done = plugins.Q.defer();
+ plugins.beautylog.log("now uploading coverage data to coveralls");
+ var stream = plugins.gulp.src([plugins.path.join(paths.cwd, "./coverage/lcov.info")])
+ .pipe(plugins.g.coveralls())
+ .pipe(plugins.g.gFunction([
+ function () {
+ var done = plugins.Q.defer();
+ plugins.beautylog.ok("Coverage data has been uploaded to Coveralls!");
+ done.resolve();
+ return done.promise;
+ }
+ ], "atEnd"));
+ stream.on("finish", function () {
+ done.resolve(configArg);
+ });
+ return done.promise;
+};
exports.run = function (configArg) {
var done = plugins.Q.defer();
var config = configArg;
@@ -18,27 +36,11 @@ exports.run = function (configArg) {
.pipe(plugins.g.istanbul.enforceThresholds({ thresholds: { global: 30 } }));
return stream;
};
- var coveralls = function () {
- plugins.beautylog.log("now uploading coverage data to coveralls");
- var stream = plugins.gulp.src([plugins.path.join(paths.cwd, "./coverage/lcov.info")])
- .pipe(plugins.g.coveralls())
- .pipe(plugins.g.gFunction(function () {
- plugins.beautylog.ok("Tests have passed and coverage data has been uploaded to Coveralls!");
- }, "atEnd"));
- return stream;
- };
plugins.beautylog.log("now starting tests");
istanbul().on("finish", function () {
mocha().on("finish", function () {
- if (plugins.smartenv.getEnv().isTravis && config.coveralls) {
- coveralls().on("finish", function () {
- done.resolve(config);
- });
- }
- else {
- plugins.beautylog.ok("Tests have passed!");
- done.resolve(config);
- }
+ plugins.beautylog.ok("Tests have passed!");
+ done.resolve(config);
});
});
return done.promise;
diff --git a/ts/npmts.jsdoc.ts b/ts/npmts.jsdoc.ts
index 3bf19fe..5fb0b04 100644
--- a/ts/npmts.jsdoc.ts
+++ b/ts/npmts.jsdoc.ts
@@ -2,8 +2,8 @@
import plugins = require("./npmts.plugins");
import paths = require("./npmts.paths");
-var genJsdoc = function(configArg){
- var done = plugins.Q.defer();
+let genJsdoc = function(configArg){
+ let done = plugins.Q.defer();
plugins.beautylog.log("now generating " + "JsDoc documentation".blue);
plugins.gulp.src([
plugins.path.join(paths.cwd,"README.md"),
@@ -20,16 +20,16 @@ var genJsdoc = function(configArg){
return done.promise;
};
-var publishDocs = function(configArg){
- var done = plugins.Q.defer();
- var gitUrl = plugins.projectinfo.npm(
+export let publishDocs = function(configArg){
+ let done = plugins.Q.defer();
+ let gitUrl = plugins.projectinfo.npm(
paths.cwd,
{
gitAccessToken:process.env.GITHUB_TOKEN
}
).git.httpsUrl;
- var deployScript = ""
+ let deployScript = ""
+ "cd " + paths.docsDir + " "
+ "&& git init " + "> /dev/null 2>&1 "
+ "&& git config user.name \"TRAVIS CI\" " + "> /dev/null 2>&1 "
@@ -52,16 +52,16 @@ var publishDocs = function(configArg){
plugins.beautylog.ok("JsDoc documentation has been deployed to GitHub!");
done.resolve(configArg);
} else {
+ console.log("GitHub documentation has not been uploaded.");
done.resolve(configArg);
}
return done.promise;
};
-export var run = function(configArg){
- var done = plugins.Q.defer();
+export let run = function(configArg){
+ let done = plugins.Q.defer();
genJsdoc(configArg)
- .then(publishDocs)
.then(done.resolve);
return done.promise;
};
\ No newline at end of file
diff --git a/ts/npmts.promisechain.ts b/ts/npmts.promisechain.ts
index 09c9a49..9eb1225 100644
--- a/ts/npmts.promisechain.ts
+++ b/ts/npmts.promisechain.ts
@@ -8,6 +8,7 @@ import NpmtsConfigFile = require("./npmts.configfile");
import NpmtsInstall = require("./npmts.install");
import NpmtsJsdoc = require("./npmts.jsdoc");
import NpmtsOptions = require("./npmts.options");
+import NpmtsPublish = require("./npmts.publish");
import NpmtsTests = require("./npmts.tests");
export var run = function(){
@@ -20,6 +21,7 @@ export var run = function(){
.then(NpmtsAssets.run)
.then(NpmtsJsdoc.run)
.then(NpmtsTests.run)
+ .then(NpmtsPublish.run)
.then(function(configArg){
let shipString = "" +
"\n" +
diff --git a/ts/npmts.publish.ts b/ts/npmts.publish.ts
new file mode 100644
index 0000000..46fe6af
--- /dev/null
+++ b/ts/npmts.publish.ts
@@ -0,0 +1,19 @@
+///
+import plugins = require("./npmts.plugins");
+import paths = require("./npmts.paths");
+import NpmtsTests = require("./npmts.tests");
+import NpmtsJsdoc = require("./npmts.jsdoc");
+
+
+export let run = function(configArg){
+ let done = plugins.Q.defer();
+ let config = configArg;
+
+ let promiseArray = [];
+ config.coveralls ? promiseArray.push(NpmtsTests.publishCoverage(configArg)) : void(0);
+ 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());
+ return done.promise;
+};
\ No newline at end of file
diff --git a/ts/npmts.tests.ts b/ts/npmts.tests.ts
index 6c07e97..f8d465f 100644
--- a/ts/npmts.tests.ts
+++ b/ts/npmts.tests.ts
@@ -1,6 +1,26 @@
///
import plugins = require("./npmts.plugins");
import paths = require("./npmts.paths");
+
+export let publishCoverage = function(configArg){
+ let done = plugins.Q.defer();
+ plugins.beautylog.log("now uploading coverage data to coveralls");
+ var stream = plugins.gulp.src([plugins.path.join(paths.cwd,"./coverage/lcov.info")])
+ .pipe(plugins.g.coveralls())
+ .pipe(plugins.g.gFunction([
+ function(){
+ let done = plugins.Q.defer();
+ plugins.beautylog.ok("Coverage data has been uploaded to Coveralls!");
+ done.resolve();
+ return done.promise;
+ }
+ ],"atEnd"));
+ stream.on("finish",function(){
+ done.resolve(configArg);
+ });
+ return done.promise;
+};
+
export var run = function(configArg) {
var done = plugins.Q.defer();
var config = configArg;
@@ -23,27 +43,11 @@ export var run = function(configArg) {
return stream;
};
- var coveralls = function(){
- plugins.beautylog.log("now uploading coverage data to coveralls");
- var stream = plugins.gulp.src([plugins.path.join(paths.cwd,"./coverage/lcov.info")])
- .pipe(plugins.g.coveralls())
- .pipe(plugins.g.gFunction(function(){
- plugins.beautylog.ok("Tests have passed and coverage data has been uploaded to Coveralls!");
- },"atEnd"));
- return stream;
- };
-
plugins.beautylog.log("now starting tests");
istanbul().on("finish",function(){
mocha().on("finish",function(){
- if(plugins.smartenv.getEnv().isTravis && config.coveralls){
- coveralls().on("finish",function(){
- done.resolve(config);
- })
- } else {
- plugins.beautylog.ok("Tests have passed!");
- done.resolve(config);
- }
+ plugins.beautylog.ok("Tests have passed!");
+ done.resolve(config);
})
});
return done.promise;