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:
@@ -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
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user