all repos — homestead @ 026f939cf91bd2dc0877e203383eacc2405f8db4

Code for my website

fix build command

Alan Pearce
commit

026f939cf91bd2dc0877e203383eacc2405f8db4

parent

3821ce6c1422ec8cced45f59e947592850e496a1

2 files changed, 17 insertions(+), 4 deletions(-)

jump to
M cmd/build/main.gocmd/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)
M internal/builder/builder.gointernal/builder/builder.go
@@ -25,10 +25,11 @@ "gitlab.com/tozd/go/errors"
) type Options struct { - Source string `conf:"default:.,short:s,flag:src"` - Destination string `conf:"default:public,short:d,flag:dest"` - Development bool `conf:"default:false,flag:dev"` - Repo *vcs.Repository `conf:"-"` + Source string `conf:"default:.,short:s,flag:src"` + Destination string `conf:"default:public,short:d,flag:dest"` + Development bool `conf:"default:false,flag:dev"` + VCSRemoteURL config.URL `conf:"default:https://git.alanpearce.eu/website"` + Repo *vcs.Repository `conf:"-"` } type Result struct {