In case the environment variable is not set, the current directory for the relative path (line 6 in db/models/custom/assignment.js) is taken to be the path from which the script was invoked.
I.e. to make it work I had to go to db/assignments/dutch-auction and run node ../../../cli/cli.js.
Is there a way to tell the path module that we want "current directory" to mean "the script's directory" instead of "the directory in which node was executed"?
In case the environment variable is not set, the current directory for the relative path (line 6 in
db/models/custom/assignment.js
) is taken to be the path from which the script was invoked.I.e. to make it work I had to go to db/assignments/dutch-auction and run node
../../../cli/cli.js
.Is there a way to tell the
path
module that we want "current directory" to mean "the script's directory" instead of "the directory in whichnode
was executed"?