npmci/dist/npmci.publish.js
2016-06-05 16:43:27 +02:00

43 lines
4.4 KiB
JavaScript

"use strict";
require("typings-global");
var plugins = require("./npmci.plugins");
var npmci_prepare_1 = require("./npmci.prepare");
var npmci_bash_1 = require("./npmci.bash");
var NpmciEnv = require("./npmci.env");
exports.publish = function (serviceArg) {
if (serviceArg === void 0) { serviceArg = "npm"; }
switch (serviceArg) {
case "npm":
return publishNpm();
case "docker":
return publishDocker();
}
};
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();
NpmciEnv.dockerFilesBuilt.forEach(function (dockerfileArg) {
dockerfileArg.push();
});
return done.promise;
};
var publishDockerTest = function () {
var done = plugins.q.defer();
NpmciEnv.dockerFilesBuilt.forEach(function (dockerfileArg) {
dockerfileArg.push();
});
done.resolve();
return done.promise;
};
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLnB1Ymxpc2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUN4QixJQUFZLE9BQU8sV0FBTSxpQkFBaUIsQ0FBQyxDQUFBO0FBQzNDLDhCQUFzQixpQkFBaUIsQ0FBQyxDQUFBO0FBQ3hDLDJCQUFtQixjQUFjLENBQUMsQ0FBQTtBQUNsQyxJQUFZLFFBQVEsV0FBTSxhQUFhLENBQUMsQ0FBQTtBQUU3QixlQUFPLEdBQUcsVUFBQyxVQUF5QjtJQUF6QiwwQkFBeUIsR0FBekIsa0JBQXlCO0lBQzNDLE1BQU0sQ0FBQyxDQUFDLFVBQVUsQ0FBQyxDQUFBLENBQUM7UUFDaEIsS0FBSyxLQUFLO1lBQ04sTUFBTSxDQUFDLFVBQVUsRUFBRSxDQUFDO1F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