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.

install.js 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /**
  2. * Copyright 2017 Google Inc. All rights reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /**
  17. * This file is part of public API.
  18. *
  19. * By default, the `puppeteer` package runs this script during the installation
  20. * process unless one of the env flags is provided.
  21. * `puppeteer-core` package doesn't include this step at all. However, it's
  22. * still possible to install a supported browser using this script when
  23. * necessary.
  24. */
  25. const compileTypeScriptIfRequired = require('./typescript-if-required');
  26. async function download() {
  27. await compileTypeScriptIfRequired();
  28. // need to ensure TS is compiled before loading the installer
  29. const {
  30. downloadBrowser,
  31. logPolitely,
  32. } = require('./lib/cjs/puppeteer/node/install');
  33. if (process.env.PUPPETEER_SKIP_DOWNLOAD) {
  34. logPolitely(
  35. '**INFO** Skipping browser download. "PUPPETEER_SKIP_DOWNLOAD" environment variable was found.'
  36. );
  37. return;
  38. }
  39. if (
  40. process.env.NPM_CONFIG_PUPPETEER_SKIP_DOWNLOAD ||
  41. process.env.npm_config_puppeteer_skip_download
  42. ) {
  43. logPolitely(
  44. '**INFO** Skipping browser download. "PUPPETEER_SKIP_DOWNLOAD" was set in npm config.'
  45. );
  46. return;
  47. }
  48. if (
  49. process.env.NPM_PACKAGE_CONFIG_PUPPETEER_SKIP_DOWNLOAD ||
  50. process.env.npm_package_config_puppeteer_skip_download
  51. ) {
  52. logPolitely(
  53. '**INFO** Skipping browser download. "PUPPETEER_SKIP_DOWNLOAD" was set in project config.'
  54. );
  55. return;
  56. }
  57. if (process.env.PUPPETEER_SKIP_CHROMIUM_DOWNLOAD) {
  58. logPolitely(
  59. '**INFO** Skipping browser download. "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" environment variable was found.'
  60. );
  61. return;
  62. }
  63. if (
  64. process.env.NPM_CONFIG_PUPPETEER_SKIP_CHROMIUM_DOWNLOAD ||
  65. process.env.npm_config_puppeteer_skip_chromium_download
  66. ) {
  67. logPolitely(
  68. '**INFO** Skipping browser download. "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" was set in npm config.'
  69. );
  70. return;
  71. }
  72. if (
  73. process.env.NPM_PACKAGE_CONFIG_PUPPETEER_SKIP_CHROMIUM_DOWNLOAD ||
  74. process.env.npm_package_config_puppeteer_skip_chromium_download
  75. ) {
  76. logPolitely(
  77. '**INFO** Skipping browser download. "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" was set in project config.'
  78. );
  79. return;
  80. }
  81. downloadBrowser();
  82. }
  83. download();