properties icon indicating copy to clipboard operation
properties copied to clipboard

can not read from another path

Open mario-s opened this issue 8 years ago • 1 comments

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

mario-s avatar Jun 07 '16 15:06 mario-s

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);

era5mx avatar Jan 21 '20 23:01 era5mx