"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const chalk_1 = require("chalk");
const common_tags_1 = require("common-tags");
const updateNotifier = require("update-notifier");
const pnpmPkgJson_1 = require("./pnpmPkgJson");
function default_1() {
    const notifier = updateNotifier({ pkg: pnpmPkgJson_1.default });
    const update = notifier.update;
    if (!update) {
        return;
    }
    const message = common_tags_1.stripIndents `
    Update available! ${chalk_1.default.red(update.current)} → ${chalk_1.default.green(update.latest)}
    ${chalk_1.default.magenta('Changelog:')} https://github.com/pnpm/pnpm/releases/tag/v${update.latest}
    Run ${chalk_1.default.magenta('pnpm i -g pnpm')} to update!

    Follow ${chalk_1.default.magenta('@pnpmjs')} for updates: https://twitter.com/pnpmjs
  `;
    notifier.notify({ message });
}
exports.default = default_1;
