♻️ Updates filepaths building
/ docker (push) Successful in 1m4s
Details
/ docker (push) Successful in 1m4s
Details
This commit is contained in:
parent
41dc86eb62
commit
0656fc8ca4
|
@ -3,15 +3,16 @@ package domain
|
|||
import (
|
||||
"net"
|
||||
"net/netip"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"testing"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
ContentDir string `env:"CONTENT_DIR" envDefault:"content/"`
|
||||
ContentDir string `env:"CONTENT_DIR" envDefault:"content"`
|
||||
Host string `env:"HOST" envDefault:"0.0.0.0"`
|
||||
ThemeDir string `env:"THEME_DIR" envDefault:"theme/"`
|
||||
StaticDir string `env:"STATIC_DIR" envDefault:"static/"`
|
||||
ThemeDir string `env:"THEME_DIR" envDefault:"theme"`
|
||||
StaticDir string `env:"STATIC_DIR" envDefault:"static"`
|
||||
Port uint16 `env:"PORT" envDefault:"3000"`
|
||||
}
|
||||
|
||||
|
@ -19,10 +20,10 @@ func TestConfig(tb testing.TB) *Config {
|
|||
tb.Helper()
|
||||
|
||||
return &Config{
|
||||
ContentDir: "testdata/content/",
|
||||
ContentDir: filepath.Join("testdata", "content"),
|
||||
Host: "0.0.0.0",
|
||||
ThemeDir: "testdata/theme/",
|
||||
StaticDir: "testdata/static/",
|
||||
ThemeDir: filepath.Join("testdata", "theme"),
|
||||
StaticDir: filepath.Join("testdata", "static"),
|
||||
Port: 3000,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ func NewFile(path string) File {
|
|||
Language: LanguageUnd,
|
||||
baseFileName: "",
|
||||
contentBaseName: "",
|
||||
dir: filepath.Dir(path) + "/",
|
||||
dir: filepath.Dir(path) + string(filepath.Separator),
|
||||
ext: strings.TrimPrefix(filepath.Ext(path), "."),
|
||||
filename: path,
|
||||
logicalName: filepath.Base(path),
|
||||
|
|
Loading…
Reference in New Issue