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.

index.js 558B

12345678910111213141516171819202122232425262728293031
  1. 'use strict';
  2. const os = require('os');
  3. const fs = require('fs');
  4. const isDocker = require('is-docker');
  5. const isWsl = () => {
  6. if (process.platform !== 'linux') {
  7. return false;
  8. }
  9. if (os.release().toLowerCase().includes('microsoft')) {
  10. if (isDocker()) {
  11. return false;
  12. }
  13. return true;
  14. }
  15. try {
  16. return fs.readFileSync('/proc/version', 'utf8').toLowerCase().includes('microsoft') ?
  17. !isDocker() : false;
  18. } catch (_) {
  19. return false;
  20. }
  21. };
  22. if (process.env.__IS_WSL_TEST__) {
  23. module.exports = isWsl;
  24. } else {
  25. module.exports = isWsl();
  26. }