Package configuration fails because process.cwd is '/'


#1

I’m having problems with language-babel due to it looking for preset dependencies in process.cwd(), which should be the project root, but is in fact ‘/’.
The package is configured correctly, so I would like to change the cwd instead of forking and hardcoding a specific exception for my case. Especially since as long as cwd is set to ‘/’ I will be vulnerable to similar errors in other packages.

Platform: Macbook Pro
Launching Atom from commandline (atom .) in the project dir gives the same result as launching the app from /Applications.


#2

Desperately bumping - I see several references when googling to how laughably simple it would be to change cwd in diverse bugs in Atom, Electron and packages, but no one actually explains it.


#3

You can use process.chdir('/some/path') to change the working directory to /some/path.


#4

OK, can I put that in an alias to pull in the actual cwd when launching Atom?
Or even better, put it in a package to automatically get it and set it_


#5

You could do it in your init.coffee. Add process.chdir(atom.project.getPaths()[0]) to your init.coffee


#6

Yep, that did it!
Thanks!