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.

chromedriver.js 746B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/env node
  2. const ChildProcess = require('child_process')
  3. const path = require('path')
  4. const command = path.join(__dirname, 'bin', 'chromedriver')
  5. const args = process.argv.slice(2)
  6. const options = {
  7. cwd: process.cwd(),
  8. env: process.env,
  9. stdio: 'inherit'
  10. }
  11. const chromeDriverProcess = ChildProcess.spawn(command, args, options)
  12. chromeDriverProcess.on('close', code => {
  13. if (code !== null && code !== 0) {
  14. throw new Error(`Chromedriver exited with error code: ${code}`)
  15. }
  16. })
  17. chromeDriverProcess.on('error', error => { throw new Error(error) })
  18. const killChromeDriver = () => {
  19. try {
  20. chromeDriverProcess.kill()
  21. } catch (ignored) {}
  22. }
  23. process.on('exit', killChromeDriver)
  24. process.on('SIGTERM', killChromeDriver)