Skip to content

Commit

Permalink
feat: enable convenient vscode debugging (#1089)
Browse files Browse the repository at this point in the history
Signed-off-by: Yilong Li <liyilongko@gmail.com>

Signed-off-by: Yilong Li <liyilongko@gmail.com>
  • Loading branch information
dragonly authored Oct 26, 2022
1 parent 753fde3 commit 3416e70
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ vendor/
go.work

.vscode/*
!.vscode/launch.json
.idea

# Local History for Visual Studio Code
Expand Down
16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "envd up",
"type": "go",
"request": "launch",
"mode": "exec",
"program": "${workspaceFolder}/debug-bin/envd",
"cwd": "directory containing build.envd",
"args": [
"up"
]
}
]
}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ generate: mockgen-install ## Generate mocks
# It is used by vscode to attach into the process.
debug-local:
@for target in $(TARGETS); do \
CGO_ENABLED=$(CGO_ENABLED) go build -trimpath \
CGO_ENABLED=$(CGO_ENABLED) go build \
-v -o $(DEBUG_DIR)/$${target} \
-gcflags='all=-N -l' \
$(CMD_DIR)/$${target}; \
Expand Down

0 comments on commit 3416e70

Please sign in to comment.