resolve resource file paths relative to working directory (#516)

This commit is contained in:
Jeff Williams 2013-11-05 21:30:28 -08:00
parent 705e72b77f
commit 15b18bab8c

View File

@ -117,9 +117,9 @@ exports.getResourcePath = function(filepath, filename) {
return true;
}
// first, try resolving it relative to the current working directory (or just normalize it
// if it's an absolute path)
result = path.resolve(filepath);
// first, try resolving it relative to the working directory (or just normalize it if it's an
// absolute path)
result = path.resolve(process.env.PWD, filepath);
if ( !pathExists(result) ) {
// next, try resolving it relative to the JSDoc directory
result = path.resolve(env.dirname, filepath);