1
0
mirror of https://github.com/axllent/mailpit.git synced 2025-08-13 20:04:49 +02:00

Fix Windows embed.FS path

This commit is contained in:
Ralph Slooten
2024-04-09 21:43:27 +12:00
parent 6a410a28b6
commit 6a62890445

View File

@@ -7,7 +7,7 @@ import (
"embed" "embed"
"encoding/json" "encoding/json"
"log" "log"
"path/filepath" "path"
"sort" "sort"
"strings" "strings"
"text/template" "text/template"
@@ -103,8 +103,8 @@ func dbApplySchemas() error {
continue continue
} }
s := schema{s.Name(), semver.MajorMinor(schemaID) + "." + semver.Patch(schemaID)} script := schema{s.Name(), semver.MajorMinor(schemaID) + "." + semver.Patch(schemaID)}
scripts = append(scripts, s) scripts = append(scripts, script)
} }
// sort schemas by semver, low to high // sort schemas by semver, low to high
@@ -123,8 +123,8 @@ func dbApplySchemas() error {
// already completed, ignore // already completed, ignore
continue continue
} }
// use path.Join for Windows compatibility, see https://github.com/golang/go/issues/44305
b, err := schemaScripts.ReadFile(filepath.Join("schemas", s.Name)) b, err := schemaScripts.ReadFile(path.Join("schemas", s.Name))
if err != nil { if err != nil {
return err return err
} }