npmci/dist/npmci.publish.js

34 lines
3.4 KiB
JavaScript
Raw 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");
var NpmciBuildDocker = require("./npmci.build.docker");
2016-06-01 03:44:48 +00:00
exports.publish = function (serviceArg) {
if (serviceArg === void 0) { serviceArg = "npm"; }
switch (serviceArg) {
case "npm":
2016-06-03 14:27:12 +00:00
return publishNpm();
2016-06-01 03:44:48 +00:00
case "docker":
2016-06-03 14:27:12 +00:00
return publishDocker();
2016-05-30 03:13:15 +00:00
}
2016-06-01 03:44:48 +00:00
};
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();
NpmciBuildDocker.readDockerfiles();
done.resolve();
2016-05-30 00:29:30 +00:00
return done.promise;
};
2016-06-06 21:53:14 +00:00
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLnB1Ymxpc2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUN4QixJQUFZLE9BQU8sV0FBTSxpQkFBaUIsQ0FBQyxDQUFBO0FBQzNDLDhCQUFzQixpQkFBaUIsQ0FBQyxDQUFBO0FBQ3hDLDJCQUFtQixjQUFjLENBQUMsQ0FBQTtBQUVsQyxJQUFZLGdCQUFnQixXQUFNLHNCQUVsQyxDQUFDLENBRnVEO0FBRTdDLGVBQU8sR0FBRyxVQUFDLFVBQXlCO0lBQXpCLDBCQUF5QixHQUF6QixrQkFBeUI7SUFDM0MsTUFBTSxDQUFDLENBQUMsVUF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