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

Join Paths Produces Incorrect Result When Passing in Path via Command Line #24

Open
jon49 opened this issue Mar 11, 2015 · 0 comments
Open

Comments

@jon49
Copy link
Contributor

jon49 commented Mar 11, 2015

These two work properly (note that there is a proposed solution at the bottom):

typson schema ./api/users.ts
typson schema api/users.ts

These produce errors:

typson schema .\api\users.ts
typson schema api\users.ts

Errors:

typson : { [Error: ENOENT, open 'C:\Users\1198462\Source\Repos\mobiledlr\mobiledlr\api\users.ts\common\mco-list.ts']
At line:2 char:1
+ typson schema api\users.ts
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: ({ [Error: ENOEN...n\mco-list.ts']:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

  errno: 34,
  code: 'ENOENT',
  path: 'C:\\Users\\1198462\\Source\\Repos\\mobiledlr\\mobiledlr\\api\\users.ts\\common\\mco-list.ts' }
...
...
...
{ [Error: ENOENT, open 'C:\Users\1198462\Source\Repos\mobiledlr\mobiledlr\api\users.ts\common\user.ts']
  errno: 34,
  code: 'ENOENT',
  path: 'C:\\Users\\1198462\\Source\\Repos\\mobiledlr\\mobiledlr\\api\\users.ts\\common\\user.ts' }
api/users.ts: error TS2095: Could not find symbol 'User'.
api/users.ts: error TS2095: Could not find symbol 'McoList'.

I'm guessing that the error comes from the function fullModulePath - but I haven't looked into that deeply. I propose either using node's path (probably not since this is used in the browser also) or do something like the following:

var s = '.\\as\\asf.ts'
s.replace(/\\/g, '/')

Let me know if you would like a pull request.

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

1 participant