ahultgren / swagger-elm

Generate Elm types and decoders based on a Swagger file
74 stars 9 forks source link

Windows compatibility #1

Closed mandrolic closed 7 years ago

mandrolic commented 8 years ago

The swagger to json script is bash only - not sure how this will cope on windows. Most of the rest is ok I think this is the only architecture sensitive thing

ahultgren commented 8 years ago

I would need help from someone using windows for this. I think something like type swagger.json > swagger-to-elm > elm-format should work if I convert swagger-to-elm to a node-script (using elm-stdio programatically) and let usage of elm-format be up to the user.

ahultgren commented 7 years ago

So I finally got around to fixing this. If you (or anyone else who happens to read this and uses windows) feel like testing if it works I would very much appreciate it.

gantony commented 7 years ago

First, thank you for creating this package!!

I tested it on Windows 7, and it works :) Both type swagger.json | swagger-to-elm | elm-format --stdin and type swagger.json | swagger-to-elm work as expected.

gantony commented 7 years ago

Messing around a bit more with this, if we want to seamlessly make it work on Windows (i.e. get npm run test-build to work as is), we can create a cat.bat file with the following content:

@echo off
call type %1
ahultgren commented 7 years ago

Great! Since it works I'm closing this issue. I don't know enough about windows development to tell if a bat file is the way to go, but if you submit a PR I'll consider it there.