UNPKG

polyglot-cli

Version:
22 lines (19 loc) 672 B
const config = require('../common/config'); const utils = require('../common/utils'); const polyglotUtils = require('../common/polyglot'); module.exports = function() { const err = polyglotUtils.checkInitErrors(); if (err) { return err; } return polyglotUtils.getLastUpdatedAt() .then((lastUpdatedAt) => { if (lastUpdatedAt === config.project.lastUpdatedAt) { return utils.log('Your translations are up to date!'); } const localLast = config.project.lastUpdatedAt || 'Never'; return utils.error(`Your translations are NOT up to date! Server: ${lastUpdatedAt} Local: ${localLast}`); }, utils.error); };