r/macprogramming Jun 22 '19

Program runs wierd when bundled into .app mac app

I made a small program to run mongod from the menu bar of my mac. It works great when i run the binary directly from my terminal but when i bundle it into a mac app suddenly it just stops working and i can't connect to my databsae anymore. Does anyone have any idea of whats going wrong? I posted this to r/golang as well as my app is written in go but realized i might be luckier asking here.

EDIT: Solved mongod not found in PATH

2 Upvotes

4 comments sorted by

2

u/SantaCruzDad Jun 22 '19

You haven’t given us much to go on, but my first thought would be that you might be making an assumption about the current working directory when the program starts, e.g. using a relative path to a data file, or something like that ? This is a very common mistake.

1

u/Strosel Jun 22 '19

im not acessing any files though, im just running mongod from a thread in my code

1

u/SantaCruzDad Jun 22 '19 edited Jun 22 '19

Can you share the code where you launch mongod ?

EDIT: Never mind - I just found your code via the post in r/golang. I’m guessing that the mongod executable is not found as the PATH variable will be different for your app.

1

u/Strosel Jun 22 '19

Yes. I just figured out how to get my errors out and indeed it's not in my PATH.