1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-09-29 15:50:10 +00:00
jfa-go/embed/external.go

21 lines
416 B
Go
Raw Normal View History

2021-02-17 14:32:03 +00:00
package main
import (
"io/fs"
"log"
"os"
"path/filepath"
)
var localFS fs.FS
var langFS fs.FS
func FSJoin(elem ...string) string { return filepath.Join(elem...) }
func loadFilesystems() {
log.Println("Using external storage")
executable, _ := os.Executable()
localFS = os.DirFS(filepath.Join(filepath.Dir(executable), "data"))
langFS = os.DirFS(filepath.Join(filepath.Dir(executable), "data", "lang"))
}