fix small promise error

This commit is contained in:
Philipp Kunz 2016-03-26 17:35:55 +01:00
parent e8238dc907
commit 60d200135e
6 changed files with 19 additions and 27 deletions

24
dist/npmts.jsdoc.js vendored
View File

@ -34,23 +34,17 @@ exports.publishDocs = function (configArg) {
+ "&& git push --force --quiet " + "&& git push --force --quiet "
+ "\"" + gitUrl + "\" " + "\"" + gitUrl + "\" "
+ "master:gh-pages " + "> /dev/null 2>&1"; + "master:gh-pages " + "> /dev/null 2>&1";
if (configArg.docs.publish) { plugins.beautylog.log("now publishing JsDoc documentation to GitHub");
plugins.beautylog.log("now publishing JsDoc documentation to GitHub"); if (!plugins.shelljs.which('git')) {
if (!plugins.shelljs.which('git')) { plugins.beautylog.error('Git is not installed!');
plugins.beautylog.error('Git is not installed!'); plugins.shelljs.exit(1);
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);
} }
else { else if (plugins.shelljs.exec(deployScript).code !== 0) {
console.log("GitHub documentation has not been uploaded."); plugins.beautylog.error('Git failed!');
done.resolve(configArg); plugins.shelljs.exit(1);
} }
plugins.beautylog.ok("JsDoc documentation has been deployed to GitHub!");
done.resolve(configArg);
return done.promise; return done.promise;
}; };
exports.run = function (configArg) { exports.run = function (configArg) {

View File

@ -40,6 +40,9 @@ exports.run = function () {
console.log(shipString); console.log(shipString);
plugins.beautylog.success("READY TO SHIP!"); plugins.beautylog.success("READY TO SHIP!");
} }
else {
plugins.beautylog.success("Done!");
}
}); });
return promisechain; return promisechain;
}; };

View File

@ -10,6 +10,6 @@ exports.run = function (configArg) {
config.coveralls ? promiseArray.push(NpmtsTests.publishCoverage(configArg)) : void (0); config.coveralls ? promiseArray.push(NpmtsTests.publishCoverage(configArg)) : void (0);
config.docs.publish ? promiseArray.push(NpmtsJsdoc.publishDocs(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); promiseArray.length === 0 ? plugins.beautylog.info("Did not publish anything!") : void (0);
plugins.Q.all(promiseArray).then(done.resolve()); plugins.Q.all(promiseArray).then(done.resolve);
return done.promise; return done.promise;
}; };

13
dist/npmts.tests.js vendored
View File

@ -7,17 +7,10 @@ exports.publishCoverage = function (configArg) {
plugins.beautylog.log("now uploading coverage data to coveralls"); plugins.beautylog.log("now uploading coverage data to coveralls");
var stream = plugins.gulp.src([plugins.path.join(paths.cwd, "./coverage/lcov.info")]) var stream = plugins.gulp.src([plugins.path.join(paths.cwd, "./coverage/lcov.info")])
.pipe(plugins.g.coveralls()) .pipe(plugins.g.coveralls())
.pipe(plugins.g.gFunction([ .pipe(plugins.g.gFunction(function () {
function () { plugins.beautylog.ok("Coverage data has been uploaded to Coveralls!");
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); done.resolve(configArg);
}); }, "atEnd"));
return done.promise; return done.promise;
}; };
exports.run = function (configArg) { exports.run = function (configArg) {

View File

@ -40,6 +40,8 @@ export var run = function(){
if (process.env.CI){ if (process.env.CI){
console.log(shipString); console.log(shipString);
plugins.beautylog.success("READY TO SHIP!"); plugins.beautylog.success("READY TO SHIP!");
} else {
plugins.beautylog.success("Done!")
} }
}); });

View File

@ -14,6 +14,6 @@ export let run = function(configArg){
config.docs.publish ? promiseArray.push(NpmtsJsdoc.publishDocs(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); promiseArray.length === 0 ? plugins.beautylog.info("Did not publish anything!") : void(0);
plugins.Q.all(promiseArray).then(done.resolve()); plugins.Q.all(promiseArray).then(done.resolve);
return done.promise; return done.promise;
}; };