You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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?
The text was updated successfully, but these errors were encountered:
It's always an issue working with file paths in cross-platform environment, first the back-slashes and now different letter case. It's really strange that node fs returns different paths in this situation.
Anyway, the only solution will be normalizing the case as well, applying toLowerCase() in paths at file-tree/index.js.
I suggest you hotfixing it locally for now, and I will investigate this issue with more focus, applying the fix in one of the 0.5.x versions.
Could you please also provide the link to Windows Powershell download, and define it's version?
Hi Robert, powershell was preinstalled on my windows 8.1. Here is a PS version:
PS C:\Users\Sergey> $PSVersionTable.PSVersion
Major Minor Build Revision
----- ----- ----- --------
4 0 -1 -1
I verified on node 0.12.0, windows 8.1 with PS 4.0 and on node 0.11.13, windows server 2008 with PS 2.0 - it works the same way, drive letter is in uppercase.
Following my tests, it's true both for cmd and powershell on windows 8.1. Here's also a similar issue in Node.js project - nodejs/node-v0.x-archive#7031.
Since Windows is case-insensetive, then I believe lowering the disk name by default will be a stable fix.
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: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, '/');
andglobal.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... :SSo I guess there should be conversion to lowercase?
The text was updated successfully, but these errors were encountered: