r8s-cli
Version:
A command line tool for Reaction Commerce to be used with kubernetes
33 lines (22 loc) • 1.47 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.processNotifications = processNotifications;
var _config = require('./config');
var Config = _interopRequireWildcard(_config);
var _logger = require('./logger');
var _logger2 = _interopRequireDefault(_logger);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
var hostingPlatformNotification = '\n********************************************************************************\n ' + _logger2.default.bold('Need help with deployment?') + '\n Learn more about the Reaction Platform: ' + _logger2.default.magenta('http://getrxn.io/managed-platform') + '\n********************************************************************************\n';
function processNotifications() {
var installedSince = Config.get('id', 'since');
var timeSinceInstall = Date.now() - installedSince;
var twoWeeks = 2 * 7 * 24 * 60 * 1000;
var hasBeenNotified = Config.get('id', 'notifications.hosting');
if (timeSinceInstall > twoWeeks && !hasBeenNotified) {
_logger2.default.info(hostingPlatformNotification);
Config.set('id', 'notifications.hosting', true);
}
}
;