2016-05-25 03:23:48 +00:00
|
|
|
import "typings-global";
|
2016-03-26 13:08:48 +00:00
|
|
|
import plugins = require("./npmts.plugins");
|
|
|
|
import paths = require("./npmts.paths");
|
|
|
|
import NpmtsJsdoc = require("./npmts.jsdoc");
|
|
|
|
|
2016-05-29 18:56:53 +00:00
|
|
|
export let publishCoverage = function(configArg){
|
|
|
|
let done = plugins.Q.defer();
|
|
|
|
plugins.beautylog.log("now uploading coverage data to codecov.io");
|
|
|
|
var stream = plugins.gulp.src([plugins.path.join(paths.cwd,"./coverage/lcov.info")])
|
|
|
|
.pipe(plugins.g.codecov())
|
|
|
|
.pipe(plugins.g.gFunction(function(){
|
|
|
|
plugins.beautylog.ok("Coverage data has been uploaded to codecov.io!");
|
|
|
|
done.resolve(configArg);
|
|
|
|
},"atEnd"));
|
|
|
|
return done.promise;
|
|
|
|
};
|
2016-03-26 13:08:48 +00:00
|
|
|
|
|
|
|
export let run = function(configArg){
|
|
|
|
let done = plugins.Q.defer();
|
|
|
|
let config = configArg;
|
|
|
|
let promiseArray = [];
|
2016-05-29 18:56:53 +00:00
|
|
|
config.codecov.publish ? promiseArray.push(publishCoverage(configArg)) : void(0);
|
2016-03-26 13:08:48 +00:00
|
|
|
config.docs.publish ? promiseArray.push(NpmtsJsdoc.publishDocs(configArg)) : void(0);
|
|
|
|
promiseArray.length === 0 ? plugins.beautylog.info("Did not publish anything!") : void(0);
|
|
|
|
|
2016-03-26 16:35:55 +00:00
|
|
|
plugins.Q.all(promiseArray).then(done.resolve);
|
2016-03-26 13:08:48 +00:00
|
|
|
return done.promise;
|
|
|
|
};
|