1 | "use strict";
|
---|
2 | /**
|
---|
3 | * @license
|
---|
4 | * Copyright Google LLC All Rights Reserved.
|
---|
5 | *
|
---|
6 | * Use of this source code is governed by an MIT-style license that can be
|
---|
7 | * found in the LICENSE file at https://angular.io/license
|
---|
8 | */
|
---|
9 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
10 | exports.NodePackageInstallTask = void 0;
|
---|
11 | const options_1 = require("./options");
|
---|
12 | class NodePackageInstallTask {
|
---|
13 | constructor(options) {
|
---|
14 | this.quiet = true;
|
---|
15 | this.hideOutput = true;
|
---|
16 | if (typeof options === 'string') {
|
---|
17 | this.workingDirectory = options;
|
---|
18 | }
|
---|
19 | else if (typeof options === 'object') {
|
---|
20 | if (options.quiet != undefined) {
|
---|
21 | this.quiet = options.quiet;
|
---|
22 | }
|
---|
23 | if (options.hideOutput != undefined) {
|
---|
24 | this.hideOutput = options.hideOutput;
|
---|
25 | }
|
---|
26 | if (options.workingDirectory != undefined) {
|
---|
27 | this.workingDirectory = options.workingDirectory;
|
---|
28 | }
|
---|
29 | if (options.packageManager != undefined) {
|
---|
30 | this.packageManager = options.packageManager;
|
---|
31 | }
|
---|
32 | if (options.packageName != undefined) {
|
---|
33 | this.packageName = options.packageName;
|
---|
34 | }
|
---|
35 | }
|
---|
36 | }
|
---|
37 | toConfiguration() {
|
---|
38 | return {
|
---|
39 | name: options_1.NodePackageName,
|
---|
40 | options: {
|
---|
41 | command: 'install',
|
---|
42 | quiet: this.quiet,
|
---|
43 | hideOutput: this.hideOutput,
|
---|
44 | workingDirectory: this.workingDirectory,
|
---|
45 | packageManager: this.packageManager,
|
---|
46 | packageName: this.packageName,
|
---|
47 | },
|
---|
48 | };
|
---|
49 | }
|
---|
50 | }
|
---|
51 | exports.NodePackageInstallTask = NodePackageInstallTask;
|
---|