1 line
949 B
JavaScript
1 line
949 B
JavaScript
"use strict";function r(r,e,c,l){o(r,e,function(e,o){return e?void c(e):void i("9222:localhost:9222",function(e){if(e)return void c(e);var l=t("sh",["-c","ssh -f -N -L 9222:localhost:9222 root@"+r.ip]);l.stdout.on("data",function(r){process.stdout.write(r)}),l.on("exit",function(){n("http://localhost:9222/json",function(r,e,n){if(r||200!=e.statusCode)return void c(new Error("Couldn't fetch debugger apps list: "+r));try{!function(){var r=JSON.parse(n);i("debugger-app",function(e){if(e)return void c(e);var n=u.resolve(__dirname,"./debugger-app.js"),i=""+s()+" "+n+" http://localhost:9222"+r[0].devtoolsFrontendUrl+" &",l=t("sh",["-c",""+i]);l.unref(),c(null,o)})}()}catch(l){return void c(l)}})})})},l)}var e=function(r){return r&&r.__esModule?r["default"]:r},t=require("child_process").spawn,o=e(require("./run")),n=e(require("request")),u=e(require("path")),i=e(require("./kill-process")),s=e(require("../get-electron-path"));module.exports=r; |