improve path processing
This commit is contained in:
parent
e07f0fa6e3
commit
5329537a2f
@ -23,6 +23,7 @@ type App struct {
|
|||||||
ctx context.Context
|
ctx context.Context
|
||||||
HasConfigData bool
|
HasConfigData bool
|
||||||
ConfigData map[string]any
|
ConfigData map[string]any
|
||||||
|
Dev bool
|
||||||
exDir string
|
exDir string
|
||||||
cmdPrefix string
|
cmdPrefix string
|
||||||
}
|
}
|
||||||
@ -48,7 +49,11 @@ func (a *App) OnStartup(ctx context.Context) {
|
|||||||
a.exDir = filepath.Dir(ex) + "/"
|
a.exDir = filepath.Dir(ex) + "/"
|
||||||
a.cmdPrefix = "cd " + a.exDir + " && "
|
a.cmdPrefix = "cd " + a.exDir + " && "
|
||||||
}
|
}
|
||||||
os.Chdir(a.exDir)
|
if a.Dev {
|
||||||
|
a.exDir = ""
|
||||||
|
} else {
|
||||||
|
os.Chdir(a.exDir)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
os.Chmod(a.exDir+"backend-rust/webgpu_server", 0777)
|
os.Chmod(a.exDir+"backend-rust/webgpu_server", 0777)
|
||||||
|
12
main.go
12
main.go
@ -67,9 +67,12 @@ var midiAssets embed.FS
|
|||||||
var components embed.FS
|
var components embed.FS
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
dev := true
|
// Create an instance of the app structure
|
||||||
|
app := backend.NewApp()
|
||||||
|
app.Dev = true
|
||||||
|
|
||||||
if buildInfo, ok := debug.ReadBuildInfo(); !ok || strings.Contains(buildInfo.String(), "-ldflags") {
|
if buildInfo, ok := debug.ReadBuildInfo(); !ok || strings.Contains(buildInfo.String(), "-ldflags") {
|
||||||
dev = false
|
app.Dev = false
|
||||||
|
|
||||||
backend.CopyEmbed(assets)
|
backend.CopyEmbed(assets)
|
||||||
os.RemoveAll("./py310/Lib/site-packages/cyac-1.7.dist-info")
|
os.RemoveAll("./py310/Lib/site-packages/cyac-1.7.dist-info")
|
||||||
@ -83,9 +86,6 @@ func main() {
|
|||||||
backend.CopyEmbed(components)
|
backend.CopyEmbed(components)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create an instance of the app structure
|
|
||||||
app := backend.NewApp()
|
|
||||||
|
|
||||||
var zoomFactor float64 = 1.0
|
var zoomFactor float64 = 1.0
|
||||||
data, err := app.ReadJson("config.json")
|
data, err := app.ReadJson("config.json")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
@ -99,7 +99,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var logger wailsLogger.Logger
|
var logger wailsLogger.Logger
|
||||||
if dev {
|
if app.Dev {
|
||||||
logger = wailsLogger.NewDefaultLogger()
|
logger = wailsLogger.NewDefaultLogger()
|
||||||
} else {
|
} else {
|
||||||
logger = wailsLogger.NewFileLogger("crash.log")
|
logger = wailsLogger.NewFileLogger("crash.log")
|
||||||
|
Loading…
Reference in New Issue
Block a user