UNPKG

@lenne.tech/cli

Version:

lenne.Tech CLI: lt

38 lines (37 loc) 1.59 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); /** * Update npm packages */ const NewCommand = { alias: ['u', 'up'], description: 'Update npm packages', hidden: false, name: 'update', run: (toolbox) => __awaiter(void 0, void 0, void 0, function* () { // Retrieve the tools we need const { helper, npm, print: { success }, system, } = toolbox; // Start timer const timer = system.startTimer(); // Update yield npm.update({ install: true, showError: true }); // Success info success(`Updated npm packages in ${helper.msToMinutesAndSeconds(timer())}m.`); // Exit if not running from menu if (!toolbox.parameters.options.fromGluegunMenu) { process.exit(); } // For tests return 'updated npm packages'; }), }; exports.default = NewCommand;