aboutsummaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
authorHenrique Dias <hacdias@gmail.com>2023-11-07 20:45:45 +0100
committerGitHub <noreply@github.com>2023-11-07 11:45:45 -0800
commit550450a3b1e07a70a506d872137ea43774d2c5e0 (patch)
treed75e2174eeb6ba9197fbf70ce97f3567a6322859 /config.go
parent35e7777d1a11bff5e192aaae3145685a6a2aec60 (diff)
downloadsally-550450a3b1e07a70a506d872137ea43774d2c5e0.tar.gz
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.
Diffstat (limited to '')
-rw-r--r--config.go14
1 files changed, 14 insertions, 0 deletions
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
}