veo-labs / ldap-server-mock

Really simple basic mock for LDAP server
GNU Affero General Public License v3.0
66 stars 26 forks source link

File path is relative to the executable directory instead of the directory node executes from... #6

Closed nvrnight closed 4 years ago

nvrnight commented 5 years ago

Windows 10. NPM 6.5.0

Directory Structure: C:\Code\LDAPMock\node_modules C:\Code\LDAPMock\users.json C:\Code\LDAPMock\config.json

Open Terminal cd to C:\Code\LDAPMock

When I run with the full path it works fine: node node_modules/ldap-server-mock/server.js --conf="C:\Code\LDAPMock\config.json" --database="C:\Code\LDAPMock\users.json"

When I run with relative path(current directory is LDAPMock), it doesn't work: node node_modules/ldap-server-mock/server.js --conf=".\config.json" --database=".\users.json"

If I put my two json files in the node_modules/ldap-server-mock/ directory instead, the relative pathing works fine. It seems like weird usability that it would be relative to the executable instead of the directory your terminal is in though. So the command below will work, but is not ideal.

node node_modules/ldap-server-mock/server.js --conf=".\..\..\config.json" --database=".\..\..\users.json"

maxime-beguin commented 4 years ago

@nvrnight: thank you for pointing that out! It has been fixed in branch develop and will be released soon.

maxime-beguin commented 4 years ago

Released.