From 61ccd16ee19a2cfe243f0fbbabe7f2486113395d Mon Sep 17 00:00:00 2001 From: Stuart Douglas Date: Thu, 26 Sep 2024 08:48:29 +1000 Subject: [PATCH] chore: add ftlDebug script (#2742) This makes it easy to run FTL under dlv, and dlv will wait for the IDE to attach. This is useful if you want to debug commands other than ftl dev --- scripts/ftlDebug | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 scripts/ftlDebug diff --git a/scripts/ftlDebug b/scripts/ftlDebug new file mode 100755 index 0000000000..1a66b172e3 --- /dev/null +++ b/scripts/ftlDebug @@ -0,0 +1,13 @@ +#!/bin/bash +# Note that this does not seem to work in intellij, as it can't handle dlv without --continue +# VS Code works great though +set -euo pipefail +ftldir="$(dirname "$(readlink -f "$0")")/.." +name="ftl" +dest="${ftldir}/build/devel" +src="./cmd/${name}" +if [ "${name}" = "ftl" ]; then + src="./frontend/cli" +fi +mkdir -p "$dest" +(cd "${ftldir}/${src}" && dlv debug --headless --listen=:2345 --api-version=2 --log --accept-multiclient -- "$@" )