Skip to content

Issue with generated urls when running node via powershell #130

@webuniverseio

Description

@webuniverseio

When I get api/specs/raw json data, it contains local file paths instead or urls. I digged through the code a bit and found out why it is happening. In file-tree/index.js there is a line:

urlForJson = _specPath.replace(normalizedPathToApp, '');

The issue is happening when _specPath is different from normalizedPathToApp, for example when drive letter has different case:
_specPath = c:/dev/node_projects/sourcejs/docs/auth/readme.md
normalizedPathToApp = C:/dev/node_projects/sourcejs

It could happen because var normalizedPathToApp = global.pathToApp.replace(/\\/g, '/'); and global.pathToApp = __dirname;. Funny enough but when node started via powershell, __dirname will return path with drive letter in uppercase, while when started with cmd, node will return path with lowercase... :S

So I guess there should be conversion to lowercase?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions