install-task.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const options_1 = require("./options");
  4. class NodePackageInstallTaskOptions {
  5. }
  6. exports.NodePackageInstallTaskOptions = NodePackageInstallTaskOptions;
  7. class NodePackageInstallTask {
  8. constructor(options) {
  9. this.quiet = true;
  10. if (typeof options === 'string') {
  11. this.workingDirectory = options;
  12. }
  13. else if (typeof options === 'object') {
  14. if (options.quiet != undefined) {
  15. this.quiet = options.quiet;
  16. }
  17. if (options.workingDirectory != undefined) {
  18. this.workingDirectory = options.workingDirectory;
  19. }
  20. if (options.packageManager != undefined) {
  21. this.packageManager = options.packageManager;
  22. }
  23. if (options.packageName != undefined) {
  24. this.packageName = options.packageName;
  25. }
  26. }
  27. }
  28. toConfiguration() {
  29. return {
  30. name: options_1.NodePackageName,
  31. options: {
  32. command: 'install',
  33. quiet: this.quiet,
  34. workingDirectory: this.workingDirectory,
  35. packageManager: this.packageManager,
  36. packageName: this.packageName,
  37. },
  38. };
  39. }
  40. }
  41. exports.NodePackageInstallTask = NodePackageInstallTask;