angular / ts-api-guardian

MIT License
15 stars 15 forks source link

Does not work on Windows due to path delimiter issues #13

Open marcuskrahl opened 7 years ago

marcuskrahl commented 7 years ago

The command gulp public-api:update fails on Windows with the error:

Error: Source file "dist\packages-dist\core\index.d.ts" not found

However the file exists. It is not found because the path string is made of Windows path delimiters \ instead of Unix delimiters /.

As a dirty hack you can change this.fileName = fileName; in the ResolvedDeclarationEmitter constructor to this.fileName = fileName.replace(/\\/g,"/");. With this change the update command runs successfully. However a more appropriate fix might be necessary.

steidinger commented 7 years ago

I had the same problem using the cli on Windows and used path.normalize to fix the problem locally. Running the tests on Windows resulted in a few errors due to the different line endings on Windows. I've managed to get the unit and integration tests to run without errors.