quallaa-cli
Version:
Sets up core infrastructure services for AI-assisted development
28 lines • 1.13 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.checkForUpdates = checkForUpdates;
const update_notifier_1 = __importDefault(require("update-notifier"));
const chalk_1 = __importDefault(require("chalk"));
async function checkForUpdates() {
try {
const pkg = require('../../../package.json');
const notifier = (0, update_notifier_1.default)({
pkg,
updateCheckInterval: 1000 * 60 * 60 * 24,
});
if (notifier.update) {
const message = `
${chalk_1.default.yellow('📦 Update available!')} ${chalk_1.default.gray(notifier.update.current)} → ${chalk_1.default.green(notifier.update.latest)}
Run ${chalk_1.default.cyan(`npm install -g ${pkg.name}`)} to update
`;
console.log(chalk_1.default.bgYellow.black(' UPDATE ') + message);
}
}
catch (error) {
console.debug('Update check failed:', error);
}
}
//# sourceMappingURL=update-checker.js.map