remove unused vcs support
Alan Pearce alan@alanpearce.eu
Thu, 30 Jan 2025 15:22:38 +0100
1 files changed, 0 insertions(+), 30 deletions(-)
jump to
M internal/server/server.go → internal/server/server.go
@@ -6,8 +6,6 @@ "fmt" "net" "net/http" "net/url" - "os" - "path/filepath" "regexp" "slices" "strconv" @@ -17,11 +15,9 @@ "go.alanpearce.eu/website/internal/builder" cfg "go.alanpearce.eu/website/internal/config" "go.alanpearce.eu/website/internal/storage/sqlite" - "go.alanpearce.eu/website/internal/vcs" "go.alanpearce.eu/website/internal/website" "go.alanpearce.eu/x/log" - "github.com/ardanlabs/conf/v3" "github.com/osdevisnot/sorvor/pkg/livereload" "gitlab.com/tozd/go/errors" ) @@ -103,32 +99,6 @@ func New(runtimeConfig *Config, log *log.Logger) (*Server, error) { builderConfig := &builder.IOConfig{ Destination: runtimeConfig.Root, Development: runtimeConfig.Development, - } - - if !runtimeConfig.Development { - vcsConfig := &vcs.Config{} - _, err := conf.Parse("VCS", vcsConfig) - if err != nil { - return nil, err - } - if vcsConfig.LocalPath != "" { - _, err = vcs.CloneOrUpdate(vcsConfig, log.Named("vcs")) - if err != nil { - return nil, err - } - err = os.Chdir(runtimeConfig.Root) - if err != nil { - return nil, err - } - - builderConfig.Source = vcsConfig.LocalPath - - publicDir := filepath.Join(runtimeConfig.Root, "public") - builderConfig.Destination = publicDir - runtimeConfig.Root = publicDir - } else { - log.Warn("in production mode without VCS configuration") - } } config, err := cfg.GetConfig(builderConfig.Source, log.Named("config"))