Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

initialisePlugin.js 1.2KB

123456789101112131415161718192021222324252627282930
  1. "use strict";
  2. var __importDefault = (this && this.__importDefault) || function (mod) {
  3. return (mod && mod.__esModule) ? mod : { "default": mod };
  4. };
  5. Object.defineProperty(exports, "__esModule", { value: true });
  6. const path_1 = __importDefault(require("path"));
  7. const utils_1 = require("./utils");
  8. function initialisePlugin(name, type) {
  9. if (name[0] === '@' || path_1.default.isAbsolute(name)) {
  10. const service = utils_1.safeRequire(name);
  11. if (service) {
  12. return service;
  13. }
  14. }
  15. if (typeof type !== 'string') {
  16. throw new Error('No plugin type provided');
  17. }
  18. const scopedPlugin = utils_1.safeRequire(`@wdio/${name.toLowerCase()}-${type}`);
  19. if (scopedPlugin) {
  20. return scopedPlugin;
  21. }
  22. const plugin = utils_1.safeRequire(`wdio-${name.toLowerCase()}-${type}`);
  23. if (plugin) {
  24. return plugin;
  25. }
  26. throw new Error(`Couldn't find plugin "${name}" ${type}, neither as wdio scoped package ` +
  27. `"@wdio/${name.toLowerCase()}-${type}" nor as community package ` +
  28. `"wdio-${name.toLowerCase()}-${type}". Please make sure you have it installed!`);
  29. }
  30. exports.default = initialisePlugin;