Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #!/usr/bin/env node
  2. 'use strict'
  3.  
  4. const { dirname } = require('path')
  5. const { spawn } = require('child_process')
  6. const base = dirname(process.argv[1])
  7. const node = spawn('node', ['--inspect-brk', ...process.argv.slice(2)])
  8.  
  9. node.stdout.pipe(process.stdout)
  10. node.stderr.pipe(process.stderr)
  11.  
  12. node.stderr.on('data', m => {
  13. try {
  14. const [ , url ] = m.toString().match(/chrome-devtools(.*?)\s/)
  15.  
  16. const electron = spawn('node', [
  17. `${base}/node_modules/electron/cli.js`,
  18. `${base}/electron.js`,
  19. `chrome-devtools${url}`
  20. ])
  21. } catch(e) {}
  22. })
  23.  
  24. node.on('close', m => process.exit())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement