Skip to content

Commit 891b746

Browse files
authored
Merge pull request #13 from konradodwrot/add-code-makefile-target
add makefile target to open devcontainer within specified directory
2 parents 56b0eef + 61587bf commit 891b746

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: help prepare-env prepare-ssh build up down clean shell logs-proxy setup test
1+
.PHONY: help prepare-env prepare-ssh build up down clean shell logs-proxy setup test code
22

33
help:
44
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_.-]+:.*?## / {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
@@ -41,3 +41,10 @@ test: ## Run proxy rule tests inside the workspace container
4141
WORKSPACE_MOUNT=$(CURDIR) docker compose exec -T workspace bats /root/workspace/tests/proxy.bats
4242

4343
setup: prepare-env prepare-ssh build up ## Full setup: env, ssh, build, up
44+
45+
code: up ## Open VSCode in dev container within specified directory, defaults to /root/workspace (usage: make code [DIR=A2A])
46+
@hex=$$(printf '%s' "$(CURDIR)" | od -An -tx1 | tr -d ' \n'); \
47+
path="/root/workspace$(if $(DIR),/$(DIR),)"; \
48+
uri="vscode-remote://dev-container+$$hex$$path"; \
49+
echo "Opening $$uri"; \
50+
code --folder-uri "$$uri"

0 commit comments

Comments
 (0)