npmci/dist/npmci.publish.js

45 lines
4.3 KiB
JavaScript
Raw Permalink Normal View History

2016-05-30 00:29:30 +00:00
"use strict";
require("typings-global");
var plugins = require("./npmci.plugins");
2016-06-01 03:44:48 +00:00
var npmci_prepare_1 = require("./npmci.prepare");
2016-05-30 01:40:07 +00:00
var npmci_bash_1 = require("./npmci.bash");
2016-06-01 03:44:48 +00:00
exports.publish = function (serviceArg) {
if (serviceArg === void 0) { serviceArg = "npm"; }
2016-05-30 00:29:30 +00:00
var done = plugins.q.defer();
2016-06-01 03:44:48 +00:00
switch (serviceArg) {
case "npm":
publishNpm()
.then(function () {
done.resolve();
});
break;
case "docker":
publishDocker()
.then(function () {
done.resolve();
});
2016-05-30 03:13:15 +00:00
}
2016-06-01 03:44:48 +00:00
return done.promise;
};
var publishNpm = function () {
var done = plugins.q.defer();
npmci_prepare_1.prepare("npm")
.then(function () {
npmci_bash_1.bash("npm publish");
plugins.beautylog.ok("Done!");
done.resolve();
});
return done.promise;
};
var publishDocker = function () {
var done = plugins.q.defer();
npmci_prepare_1.prepare("docker")
.then(function () {
npmci_bash_1.bash("docker push");
2016-06-02 11:08:15 +00:00
done.resolve();
2016-06-01 03:44:48 +00:00
});
2016-05-30 00:29:30 +00:00
return done.promise;
};
2016-06-02 11:08:15 +00:00
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLnB1Ymxpc2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUN4QixJQUFZLE9BQU8sV0FBTSxpQkFBaUIsQ0FBQyxDQUFBO0FBQzNDLDhCQUFzQixpQkFBaUIsQ0FBQyxDQUFBO0FBQ3hDLDJCQUFtQixjQUFjLENBQUMsQ0FBQTtBQUV2QixlQUFPLEdBQUcsVUFBQyxVQUF5QjtJQUF6QiwwQkFBeUIsR0FBekIsa0JBQXlCO0lBQzNDLEl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S5wcm9taXNlO1xyXG59O1xyXG5cclxubGV0IHB1Ymxpc2hOcG0gID0gZnVuY3Rpb24oKXtcclxuICAgIGxldCBkb25lID0gcGx1Z2lucy5xLmRlZmVyKCk7XHJcbiAgICBwcmVwYXJlKFwibnBtXCIpXHJcbiAgICAgICAgLnRoZW4oZnVuY3Rpb24oKXtcclxuICAgICAgICAgICAgYmFzaChcIm5wbSBwdWJsaXNoXCIpO1xyXG4gICAgICAgICAgICBwbHVnaW5zLmJlYXV0eWxvZy5vayhcIkRvbmUhXCIpIDtcclxuICAgICAgICAgICAgZG9uZS5yZXNvbHZlKCk7XHJcbiAgICAgICAgfSk7XHJcbiAgIHJldHVybiBkb25lLnByb21pc2U7XHJcbn1cclxuXHJcbmxldCBwdWJsaXNoRG9ja2VyID0gZnVuY3Rpb24oKXtcclxuICAgIGxldCBkb25lID0gcGx1Z2lucy5xLmRlZmVyKCk7XHJcbiAgICBwcmVwYXJlKFwiZG9ja2VyXCIpXHJcbiAgICAgICAgLnRoZW4oZnVuY3Rpb24oKXtcclxuICAgICAgICAgICAgYmFzaChcImRvY2tlciBwdXNoXCIpO1xyXG4gICAgICAgICAgICBkb25lLnJlc29sdmUoKTtcclxuICAgICAgICB9KTtcclxuICAgIHJldHVybiBkb25lLnByb21pc2U7XHJcbn07Il19