charto / cxsd

Streaming XSD parser and XML parser generator with TypeScript output
MIT License
111 stars 55 forks source link

Problems using cxsd on Windows #5

Closed patrickmeiring closed 8 years ago

patrickmeiring commented 8 years ago

Exporter.js uses a regex to replace path separators with forward slashes. On Windows, path.sep is a backslash, making the regex invalid as it is not escaped beforehand.

Stack trace: Unhandled rejection SyntaxError: Invalid regular expression: /\/: \ at end of pattern at new RegExp (native) at JS.Exporter.getPathTo (C:\cxsd\dist\schema\exporter\Exporter.js:48:72) at JS.Exporter.writeHeader (C:\cxsd\dist\schema\exporter\Exporter.js:24:37) at JS.writeContents (C:\cxsd\dist\schema\exporter\JS.js:211:17) at C:\cxsd\dist\schema\exporter\Exporter.js:40:60 From previous event: at JS.Exporter.prepare (C:\cxsd\dist\schema\exporter\Exporter.js:37:52) at JS.Transform.exec (C:\cxsd\dist\schema\transform\Transform.js:38:38) at C:\cxsd\dist\cli.js:52:62

jjrv commented 8 years ago

PR merged, thanks!

maiermic commented 8 years ago

@jjrv Please release this fix to npm. The current latest version cxsd@0.1.0 still contains this bug.

jjrv commented 8 years ago

Sorry for the delay, it's released now.