Skip to content

Commit

Permalink
Allow overriding name of a repository (#47)
Browse files Browse the repository at this point in the history
By specifying a "name" in the manifest, the repository
will be checked out under the given name instead of
auto-detecting the name from the repository name.

This is helpful when a fork of the graylog2-server
repository is used. The Graylog project build relies
on the server repository being checked out as
"graylog2-server".

Without this change, a repository
"Graylog2/graylog2-server-fork.git" would be checked
out as "graylog2-server-fork".

With this change, it can be named "graylog2-server" with
the git remote still pointing at
"Graylog2/graylog2-server-fork.git".
  • Loading branch information
thll authored Nov 11, 2024
1 parent b8a6a2d commit ba61ff4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions manifest/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type Manifest struct {
}

type ManifestModule struct {
Name string `json:"name,omitempty"`
Repository string `json:"repository,omitempty"`
Revision string `json:"revision,omitempty"`
Maven string `json:"maven,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion project/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func New(config config.Config, manifestFiles []string, options ...projectOption)
}

for _, module := range readManifest.Modules {
moduleName := utils.NameFromRepository(module.Repository)
moduleName, _ := utils.FirstNonEmpty(module.Name, utils.NameFromRepository(module.Repository))
moduleRepository := module.Repository
submodules := make([]Module, 0)

Expand Down

0 comments on commit ba61ff4

Please # to comment.