yyx990803/pod

app's working directory is user home

bitwit opened this issue · 3 comments

When I start the pod of a node project which writes and reads files, it is trying to do it relative to my home path instead of from the app. Is there a setting I can put in the .podrc that sets my current working directory?

Hmm I've never run into this before... my pod apps have their cwd correctly set to where app.js is located. Are you using any environment variables or something in your app?

No environment variables. We are using the 'main' in package.json to indicate our starting point. Tried this on two completely different boxes/projects and had the same result.

Out of curiousity do your personal apps explicitly set their own cwd? We are considering trying this to fix the problem.

So for the record we redployed with the very first line of our main js file as

// Set the current working directory
process.chdir(__dirname + '/../');

(we needed to back our one directory since the main file is nested in the app/ dir of our project)

and everything seems to be pathing correctly.