Simplify GUI settings and build flags

This commit is contained in:
every_holiday
2026-06-26 09:16:46 +09:00
parent 4d77e67870
commit ae426244e0
22 changed files with 846 additions and 237 deletions

View File

@@ -5,6 +5,8 @@ import (
"path/filepath"
)
var rootDirFunc = RuntimeBaseDir
func RuntimeBaseDir() string {
exe, err := os.Executable()
if err == nil {
@@ -13,4 +15,12 @@ func RuntimeBaseDir() string {
return "."
}
func RootDir() string { return RuntimeBaseDir() }
func RootDir() string { return rootDirFunc() }
func SetRootDirForTest(fn func() string) func() {
prev := rootDirFunc
rootDirFunc = fn
return func() {
rootDirFunc = prev
}
}