UNPKG

ueno-cli

Version:
31 lines 1.23 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const child_process_1 = require("child_process"); const ink_1 = require("ink"); const Spinner = require("ink-spinner"); exports.command = 'update'; exports.desc = 'Update the ueno-cli'; exports.builder = () => null; exports.handler = () => tslib_1.__awaiter(this, void 0, void 0, function* () { const currentVersion = require('../../../package.json').version; const unmount = ink_1.render((ink_1.h("div", null, ink_1.h(Spinner, null), " Checking for newer version"))); child_process_1.exec('npm update --global ueno-cli', () => { child_process_1.exec('ueno-cli --version', (err, stdout) => { unmount(); if (err !== undefined) { return; } const newVersion = String(stdout).trim(); if (newVersion === currentVersion) { console.log('You are already using the latest version:', currentVersion); } else { console.log('Bleep blob! ueno-cli has been updated to version:', newVersion); } }); }); }); //# sourceMappingURL=update.js.map