Sublime Forum

Sublime Merge usage with devcontainers

#1

I am trying to use dev containers in my development process, but I’m running into trouble with pre-commit hooks. A dev container is essentially a docker image for your dev environment. It allows your entire team to develop using a consistent system.

The problem is that npm (and other package managers) will install files using the os and architecture of the dev container, rather than the architecture of your machine. When Sublime Merge tries to run the pre-commit hooks, it runs them in the context of the host machine rather than the dev container.

There is a CLI tool for running commands in dev containers.

Adding this manually may work for me, but it would break for people that use VSCode for git, since that’s already running in the context of the docker image, and it would break things like GitHub Codespaces.

0 Likes

#2

You’d need to create a wrapper shell script around git that runs devcontainer exec git and set that shell script as the “Git Binary” in Sublime Merge’s preferences.

0 Likes

#3

Is there a way to set that per repository?

0 Likes

#4

There is not

0 Likes