pm2-gui icon indicating copy to clipboard operation
pm2-gui copied to clipboard

Need to pass fully qualified path to pm2-gui.ini

Open aeisenberg opened this issue 8 years ago • 3 comments

Loving the monitor. Thanks for implementing it. Our problem is that we need to specify a fully qualfiied path to the pm2-gui.ini. A relative path does not work.

eg-

pm2-gui start my-pm2-gui.ini

Ignores the ini file and uses the global defaults instead.

I have to do this:

pm2-gui start /etc/var/my-app/other-stuff/my-pm2-gui.ini

aeisenberg avatar Jul 02 '16 00:07 aeisenberg

Indeed :)

Tjatse avatar Jul 04 '16 02:07 Tjatse

I think I see the problem. It is here:

https://github.com/Tjatse/pm2-gui/blob/master/lib/daemon.js#L23

You are resolving the confFile relative to the path of the installation folder of pm2-gui (typically somewhere in the global npm folder), rather than the location where the process was run from.

You probably want to use process.cwd() instead of __dirname.

aeisenberg avatar Jul 04 '16 02:07 aeisenberg

Created https://github.com/Tjatse/pm2-gui/pull/39. The change is simple, but it means that all paths default to the cwd instead of the installation directory. I believe this is more intuitive and is the behavior I would like to see.

aeisenberg avatar Jul 04 '16 03:07 aeisenberg