Fix filepath separator and external files on windows

For some reason, '/' is used instead of '\' on windows when loading
lang. FSJoin will now use whatever already exists in the path.
app.GetPath now creates a DirFS from the containing directory instead of
app.systemFS, which fixes loading on windows.
This commit is contained in:
Harvey Tindall
2021-02-18 12:58:30 +00:00
parent cdc837e781
commit adbb5b9d38
5 changed files with 21 additions and 8 deletions
-2
View File
@@ -65,7 +65,6 @@ type appContext struct {
configBasePath string
configBase settings
dataPath string
systemFS fs.FS
webFS httpFS
cssClass string
jellyfinLogin bool
@@ -141,7 +140,6 @@ func start(asDaemon, firstCall bool) {
userConfigDir, _ := os.UserConfigDir()
app.dataPath = filepath.Join(userConfigDir, "jfa-go")
app.configPath = filepath.Join(app.dataPath, "config.ini")
app.systemFS = os.DirFS("/")
// gin-static doesn't just take a plain http.FileSystem, so we implement it's ServeFileSystem. See static.go.
app.webFS = httpFS{
hfs: http.FS(localFS),