UNPKG

@o3r/schematics

Version:

Schematics module of the Otter framework

37 lines 1.29 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.NpmInstall = void 0; const tasks_1 = require("@angular-devkit/schematics/tasks"); const options_1 = require("@angular-devkit/schematics/tasks/package-manager/options"); const index_1 = require("../../utility/index"); /** * Run NPM Install */ class NpmInstall extends tasks_1.NodePackageInstallTask { constructor(options) { super(options); this.quiet = false; this.force = false; this.packageManager = (0, index_1.getPackageManager)({ workspaceConfig: options?.tree && (0, index_1.getWorkspaceConfig)(options.tree), enforcedNpmManager: options?.packageName }); this.force = !!options?.force; } /** @inheritdoc */ toConfiguration() { const config = super.toConfiguration(); return { ...config, name: options_1.NodePackageName, options: { ...config.options, command: 'install', quiet: this.quiet, packageManager: `${this.packageManager}${this.force && this.packageManager === 'npm' ? ' --force' : ''}` } }; } } exports.NpmInstall = NpmInstall; //# sourceMappingURL=npm-install.js.map