UNPKG

@nu-art/commando

Version:
31 lines (30 loc) 1.19 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Commando_PNPM = void 0; const BaseCommando_1 = require("../core/BaseCommando"); const class_merger_1 = require("../core/class-merger"); const basic_1 = require("./basic"); const programming_1 = require("./programming"); const nvm_1 = require("./nvm"); const Super = (0, class_merger_1.MergeClass)(BaseCommando_1.BaseCommando, programming_1.Commando_Programming, basic_1.Commando_Basic, nvm_1.Commando_NVM); class Commando_PNPM extends Super { async installPackages() { await this .append(`pnpm store prune`) .append(`pnpm install -f --no-frozen-lockfile --prefer-offline false`) .execute(); return this; } async install(version) { await this .append(`curl -fsSL "https://get.pnpm.io/install.sh" | env PNPM_VERSION=${version} bash -`) .execute(); return this; } async getVersion() { return this.if('[[ -x "$(command -v pnpm)" ]]', (commando) => { commando.append('pnpm --version'); }).execute(stdout => stdout.trim()); } } exports.Commando_PNPM = Commando_PNPM;