gh-action-bump-version/node_modules/actions-toolkit/lib/exit.js

46 lines
1.2 KiB
JavaScript
Raw Normal View History

2021-08-07 21:20:18 +00:00
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* The code to exit an action with a "success" state
*/
exports.SuccessCode = 0;
/**
* The code to exit an action with a "failure" state
*/
exports.FailureCode = 1;
/**
* The code to exit an action with a "neutral" state
*/
exports.NeutralCode = 78;
var Exit = /** @class */ (function () {
function Exit(logger) {
this.logger = logger;
}
/**
* Stop the action with a "success" status
*/
Exit.prototype.success = function (message) {
if (message)
this.logger.success(message);
process.exit(exports.SuccessCode);
};
/**
* Stop the action with a "neutral" status
*/
Exit.prototype.neutral = function (message) {
if (message)
this.logger.info(message);
process.exit(exports.NeutralCode);
};
/**
* Stop the action with a "failed" status
*/
Exit.prototype.failure = function (message) {
if (message)
this.logger.fatal(message);
process.exit(exports.FailureCode);
};
return Exit;
}());
exports.Exit = Exit;
//# sourceMappingURL=exit.js.map