diff options
author | Alan Pearce | 2024-06-29 16:48:40 +0200 |
---|---|---|
committer | Alan Pearce | 2024-06-29 16:48:40 +0200 |
commit | b4095d108a2646bcf9e7fff64788b10d9bce8da3 (patch) | |
tree | f45554857a3128922b665ab0fb04150380c0d44e /internal/server | |
parent | e8221541404a8d2ca0758d48ba5fe9c85f9067ac (diff) | |
download | website-b4095d108a2646bcf9e7fff64788b10d9bce8da3.tar.lz website-b4095d108a2646bcf9e7fff64788b10d9bce8da3.tar.zst website-b4095d108a2646bcf9e7fff64788b10d9bce8da3.zip |
build outside of working directory
Diffstat (limited to 'internal/server')
-rw-r--r-- | internal/server/server.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/internal/server/server.go b/internal/server/server.go index 3c43812..c7b5659 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -99,7 +99,6 @@ func rebuild(builderConfig *builder.IOConfig, config *cfg.Config) error { func New(runtimeConfig *Config) (*Server, error) { builderConfig := &builder.IOConfig{ - Source: "content", Destination: runtimeConfig.Root, Development: runtimeConfig.Development, } @@ -114,19 +113,19 @@ func New(runtimeConfig *Config) (*Server, error) { if err != nil { return nil, err } - err = os.Chdir(vcsConfig.LocalPath) + err = os.Chdir(runtimeConfig.Root) if err != nil { return nil, err } - builderConfig.Source = filepath.Join(vcsConfig.LocalPath, "content") + builderConfig.Source = vcsConfig.LocalPath publicDir := filepath.Join(runtimeConfig.Root, "public") builderConfig.Destination = publicDir runtimeConfig.Root = publicDir } - config, err := cfg.GetConfig() + config, err := cfg.GetConfig(builderConfig.Source) if err != nil { return nil, errors.WithMessage(err, "error parsing configuration file") } |