From 982214c64abdd1165a4aade2a0f8c0b9c4a41fdb Mon Sep 17 00:00:00 2001 From: Antonin Hildebrand Date: Sat, 11 Jan 2020 15:38:36 +0100 Subject: [PATCH] cli: add a convenience --debug option --- scripts/main-launch-dev.sh | 2 +- src/main/dirac/main/actions/launch.clj | 9 ++++++++- src/main/dirac/main/cli.clj | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/main-launch-dev.sh b/scripts/main-launch-dev.sh index d8c76a3766..600ad9d9e2 100755 --- a/scripts/main-launch-dev.sh +++ b/scripts/main-launch-dev.sh @@ -9,4 +9,4 @@ cd "$ROOT" JVM_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=127.0.0.1:5005" export JVM_OPTS -./scripts/main.sh -vv launch --releases "$ROOT/../releases-dev.edn" "$@" +./scripts/main.sh -vv launch --releases "$ROOT/../releases-dev.edn" --debug 9222 "$@" diff --git a/src/main/dirac/main/actions/launch.clj b/src/main/dirac/main/actions/launch.clj index eb6b9fbd52..daca9b96a3 100644 --- a/src/main/dirac/main/actions/launch.clj +++ b/src/main/dirac/main/actions/launch.clj @@ -138,9 +138,16 @@ verbosity-args (if (= (:verbosity config) "ALL") ["--enable-logging=stderr" "--v=1"]) custom-devtools [(str "--custom-devtools-frontend=" "file://" frontend-dir)] devtools-experiments ["--enable-devtools-experiments"] + debugger-args (if (:debug config) [(str "--remote-debugging-port=" (:debug config))]) data-dir (if (some? chromium-data-dir) [(str "--user-data-dir=" chromium-data-dir)]) extra-args (chromium/read-chromium-extra-args) - args (concat convenience-args verbosity-args custom-devtools data-dir devtools-experiments extra-args) + args (concat convenience-args + verbosity-args + custom-devtools + data-dir + devtools-experiments + debugger-args + extra-args) profile (if (some? chromium-data-dir) (str "[with --user-data-dir='" (terminal/style-path chromium-data-dir) "'] "))] (if-not (:dry-chromium config) (do diff --git a/src/main/dirac/main/cli.clj b/src/main/dirac/main/cli.clj index 0dfed7ff65..2d0071a9b9 100644 --- a/src/main/dirac/main/cli.clj +++ b/src/main/dirac/main/cli.clj @@ -25,6 +25,7 @@ [nil "--no-profile" "Don't specify any Chromium data dir"] [nil "--chromium-version VERSION" "Force specific Chromium version, does not ask the binary"] [nil "--dry-chromium" "Don't spawn Chromium, only print launch command"] + [nil "--debug PORT" "Spawn Chromium with --remote-debugging-port=PORT"] [nil "--no-playground" "Don't support playground"] [nil "--releases PATH" "Force alternative releases.edn file, do not check for updates"] [nil "--releases-url URL" "Force alternative releases.edn url"]])