From 01d8ff6740d21674b7810a830967135cd58e0134 Mon Sep 17 00:00:00 2001 From: nightwing Date: Tue, 9 Jan 2018 00:33:12 +0400 Subject: [PATCH] add support for expanding debugport variable in runners --- plugins/c9.ide.run/run.js | 7 +++++++ plugins/c9.ide.run/runners/Node.js.run | 2 +- plugins/c9.ide.run/runners/io.js.run | 13 ------------- 3 files changed, 8 insertions(+), 14 deletions(-) delete mode 100644 plugins/c9.ide.run/runners/io.js.run diff --git a/plugins/c9.ide.run/run.js b/plugins/c9.ide.run/run.js index 3987e475..0b6f401d 100644 --- a/plugins/c9.ide.run/run.js +++ b/plugins/c9.ide.run/run.js @@ -299,6 +299,9 @@ define(function(require, module, exports) { if (deferred) return setTimeout(callback); + options.debugport = options.debugport || runner.debugport; + options.debughost = options.debughost || runner.debughost; + var cmd = ""; // Display a message prior to running the command @@ -419,6 +422,10 @@ define(function(require, module, exports) { idx = fnme.lastIndexOf("."); return idx == -1 ? fnme : fnme.substr(0, idx); } + if (name == "debugport") + return (parseInt(options.debugport) || 0) + ""; + if (name == "debughost") + return bashQuote(options.debughost); if (name == "packages") return installPath + "/packages"; if (name == "project_path") diff --git a/plugins/c9.ide.run/runners/Node.js.run b/plugins/c9.ide.run/runners/Node.js.run index ff136c71..0a96b4da 100644 --- a/plugins/c9.ide.run/runners/Node.js.run +++ b/plugins/c9.ide.run/runners/Node.js.run @@ -4,7 +4,7 @@ "${debug?--nocrankshaft}", "${debug?--nolazy}", "${debug?`node --version | grep -vqE \"v0\\..\\.\" && echo --nodead_code_elimination`}", - "${debug?--debug-brk=15454}", + "${debug?--debug-brk=$debugport}", "$file", "$args" ], diff --git a/plugins/c9.ide.run/runners/io.js.run b/plugins/c9.ide.run/runners/io.js.run deleted file mode 100644 index 84f48302..00000000 --- a/plugins/c9.ide.run/runners/io.js.run +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": [ - "iojs", - "${debug?--nocrankshaft}", - "${debug?--nolazy}", - "${debug?--nodead_code_elimination}", - "${debug?--debug-brk=15455}", - "$file", - "$args" - ], - "debugger": "v8", - "debugport": 15455 -} \ No newline at end of file