build(download): rename DownloadForgejo to Download
This commit is contained in:
parent
67510372ee
commit
5f00909726
2 changed files with 11 additions and 7 deletions
|
@ -38,18 +38,20 @@ func Clean() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// DownloadForgejo downloads the Forgejo binary from Codeberg.
|
||||
func DownloadForgejo() error {
|
||||
// Download downaloads the binaries for a given service.
|
||||
func Download(name string) error {
|
||||
cfg, err := newConfig(configFile)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to load the configuration; %v", err)
|
||||
}
|
||||
|
||||
version := cfg.Forgejo.Version
|
||||
|
||||
if err := downloadForgejo(version); err != nil {
|
||||
if name == "forgejo" {
|
||||
if err := downloadForgejo(cfg.Forgejo.Version); err != nil {
|
||||
return fmt.Errorf("an error occurred whilst getting the forgejo binary; %w", err)
|
||||
}
|
||||
} else {
|
||||
return fmt.Errorf("unsupported service: %s", name)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -21,7 +21,9 @@ func Render(name string) error {
|
|||
}
|
||||
|
||||
if name == "forgejo" || name == "all" {
|
||||
mg.Deps(DownloadForgejo)
|
||||
mg.Deps(
|
||||
mg.F(Download, "forgejo"),
|
||||
)
|
||||
}
|
||||
|
||||
if name == "all" {
|
||||
|
|
Loading…
Reference in a new issue