forked from opentofu/opentofu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
debug-opentofu
executable file
·26 lines (22 loc) · 1.13 KB
/
debug-opentofu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash
# This is a helper script to launch OpenTofu inside the "dlv" debugger,
# configured to await a remote debugging connection on port 2345. You can
# then connect to it using the following command, or its equivalent in your
# debugging frontend of choice:
# dlv connect 127.0.0.1:2345
#
# This tool does not install dlv. To install it, see its instructions:
# https://github.com/go-delve/delve/tree/master/Documentation/installation
#
# For more convenient use, you may wish to put this script in your PATH:
# ln -s ../src/github.com/opentofu/opentofu/scripts/debug-opentofu $GOPATH/bin/debug-opentofu
#
# Note that when running this script the OpenTofu binary is NOT in $GOPATH/bin,
# so any providers installed there won't be found unless OpenTofu searches
# there for some _other_ reason.
set -eu
echo "Launching OpenTofu in a headless debug session"
echo "Connect to it using: dlv connect 127.0.0.1:2345"
echo "(OpenTofu takes a long time to build and launch in this mode; some logs will appear below)"
echo "---------------------------"
exec dlv debug github.com/opentofu/opentofu --headless --listen :2345 --log -- "$@"