improve path processing

This commit is contained in:
josc146
2024-02-03 20:29:56 +08:00
parent e07f0fa6e3
commit 5329537a2f
2 changed files with 12 additions and 7 deletions

View File

@@ -23,6 +23,7 @@ type App struct {
ctx context.Context
HasConfigData bool
ConfigData map[string]any
Dev bool
exDir string
cmdPrefix string
}
@@ -48,7 +49,11 @@ func (a *App) OnStartup(ctx context.Context) {
a.exDir = filepath.Dir(ex) + "/"
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)