Skip to content

Separate go-project from git-project context #179

@tkrop

Description

@tkrop

As a user of go-make
I want to separate go-project context from git-project context
So that I can run go-make <target> in an arbitrary sub-project successfully as well as in the root project.

Currently, go-make binds the go-project context to the git-project context even switching the working directory to the root of git-project to execute targets. This does not work for git-projects that contain multiple go-projects, since the go-related targets run out of their local context and fail.

It could be possible to correctly distinguish both context using $(CURRDIR) and $(GITDIR) to run all commands in targets in their specific context. To make this applicable for running go-make in the root context, we need to change all goals to align with the actual directory where go.mod files are located using something like the following loop:

for FILE in $(find -name go.mod); do
    cd $(dirname "${FILE}");
    ...
done;

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions