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.

finder.js 1.2KB

1234567891011121314151617181920212223242526272829
  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. exports.darwinGetInstallations = exports.darwinGetAppPaths = void 0;
  7. const path_1 = __importDefault(require("path"));
  8. const child_process_1 = require("child_process");
  9. const utils_1 = require("@wdio/utils");
  10. const DARWIN_LIST_APPS = 'system_profiler SPApplicationsDataType -json';
  11. exports.darwinGetAppPaths = (app) => {
  12. const apps = JSON.parse(child_process_1.execSync(DARWIN_LIST_APPS).toString());
  13. const appPaths = apps.SPApplicationsDataType
  14. .filter(inst => inst.info && inst.info.startsWith(app))
  15. .map(inst => inst.path);
  16. return appPaths;
  17. };
  18. exports.darwinGetInstallations = (appPaths, suffixes) => {
  19. const installations = [];
  20. appPaths.forEach((inst) => {
  21. suffixes.forEach(suffix => {
  22. const execPath = path_1.default.join(inst.substring(0, inst.indexOf('.app') + 4).trim(), suffix);
  23. if (utils_1.canAccess(execPath) && installations.indexOf(execPath) === -1) {
  24. installations.push(execPath);
  25. }
  26. });
  27. });
  28. return installations;
  29. };