fix build command
1 file changed, 12 insertions(+), 0 deletions(-)
changed files
M cmd/build/main.go → cmd/build/main.go
@@ -6,11 +6,14 @@ "os" "go.alanpearce.eu/website/internal/builder" "go.alanpearce.eu/website/internal/config" + "go.alanpearce.eu/website/internal/vcs" "go.alanpearce.eu/x/log" "github.com/ardanlabs/conf/v3" "gitlab.com/tozd/go/errors" ) + +const branch = "main" func main() { builderOptions := &builder.Options{}@@ -22,6 +25,15 @@ } panic("error parsing configuration: " + err.Error()) } log := log.Configure(!builderOptions.Development) + repo, _, err := vcs.CloneOrOpen(&vcs.Options{ + LocalPath: builderOptions.Source, + RemoteURL: builderOptions.VCSRemoteURL, + Branch: branch, + }, log.Named("vcs")) + if err != nil { + panic("could not open repository: " + err.Error()) + } + builderOptions.Repo = repo log.Debug("starting build process") cfg, err := config.GetConfig(builderOptions.Source, log)