This commit is contained in:
josc146
2023-06-02 22:20:57 +08:00
parent b41a2e7039
commit e1df1bfc3f
4 changed files with 16 additions and 14 deletions

View File

@@ -28,12 +28,12 @@ func NewApp() *App {
// so we can call the runtime methods
func (a *App) OnStartup(ctx context.Context) {
a.ctx = ctx
ex, _ := os.Executable()
a.exDir = filepath.Dir(ex)
a.exDir = ""
a.cmdPrefix = ""
if runtime.GOOS == "darwin" {
a.exDir += "/../../../"
ex, _ := os.Executable()
a.exDir = filepath.Dir(ex) + "/../../../"
a.cmdPrefix = "cd " + a.exDir + " && "
}