Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not read from another path #14

Open
mario-s opened this issue Jun 7, 2016 · 1 comment
Open

can not read from another path #14

mario-s opened this issue Jun 7, 2016 · 1 comment

Comments

@mario-s
Copy link

mario-s commented Jun 7, 2016

Hi,

I'm having an issue when reading a properties file from another path relative to the caller on a Windows machine. Or in other words: I can only use the same path where the script is, which uses the properties file.

//works:
var properties = PropertiesReader('gradle.properties');

//the following combinations don't work:
var properties = PropertiesReader('./props/gradle.properties');
var properties = PropertiesReader('props\gradle.properties');
var properties = PropertiesReader('.\props\gradle.properties');
var properties = PropertiesReader('../gradle.properties');

My machine runs Windows 7 with NodeJs in version 2.14.7 and properties-reader 0.0.15

@era5mx
Copy link
Contributor

era5mx commented Jan 21, 2020

The library uses the absolute path, at the moment you cannot make use of relative paths.

You must use ...
propertiesPath = path.join (__ dirname, '\{path_And_Filename.properties}\');
var properties = PropertiesReader(propertiesPath);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants