From 550450a3b1e07a70a506d872137ea43774d2c5e0 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Tue, 7 Nov 2023 20:45:45 +0100 Subject: feat: add support for other vcs systems (#128) Adds support to other VCS systems as per the specification. Defaults to `git` for backwards compatibility. Renames the internally used `.GitURL` to `.RepoURL` for clarity. --- config.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'config.go') diff --git a/config.go b/config.go index 439bc48..25b32fd 100644 --- a/config.go +++ b/config.go @@ -46,6 +46,11 @@ type PackageConfig struct { // Defaults to the URL specified in the top-level config. URL string `yaml:"url"` + // VCS is the version control system of this module. + // + // Defaults to git. + VCS string `yaml:"vcs"` + // Desc is a plain text description of this module. Desc string `yaml:"description"` } @@ -73,5 +78,14 @@ func Parse(path string) (*Config, error) { c.Godoc.Host = host } + // Set default values for the packages. + for name, pkg := range c.Packages { + if pkg.VCS == "" { + pkg.VCS = "git" + } + + c.Packages[name] = pkg + } + return &c, err } -- cgit v1.2.3