kontent-ai / model-generator-net

Kontent.ai .NET model generator.
https://www.nuget.org/packages/Kontent.Ai.ModelGenerator
MIT License
17 stars 18 forks source link

Windows-like path separators are hardcoded #76

Closed mcetkovsky closed 6 years ago

mcetkovsky commented 6 years ago

Brief bug description

What went wrong? The code contains a hardcoded \ as a path separator. As such, the code does not generate correct paths on macOS.

Repro steps

  1. Run the generator on macOS while specifying a full path as its outputDir.

Expected behavior

You should use the built-in methods and constants to handle platform differences. For example, you should use Path.DirectorySeparatorChar instead of "\\" and Path.Combine instead of dir + file.

Note: Windows usually handle both variants of path separators \ and /. I have seen cases when a script used Linux-like separator / even it was supposed to be run on Windows as well as on other platforms with a purpose to make the script shorter and easier to read. Ideally, you should be compatible with this as well.

Test environment

B1tF8er commented 6 years ago

Hello could I start to work on this bug?

Simply007 commented 6 years ago

Hey @B1tF8er, absolutely! If you accept the invitation that I've just sent you, I'll be able to assign the issue to you. (So that nobody can steal it from you :))

B1tF8er commented 6 years ago

Just accepted the invitation :)

petrsvihlik commented 6 years ago

@B1tF8er if you need any technical advice, let us know ;)

B1tF8er commented 6 years ago

Hello, I created an account in Kentico to get a ProjectId but I got the following error, what I am missing? fullsizeoutput_4

petrsvihlik commented 6 years ago

I think you need to use --projectid if you run it via dotnet run.