Open mdrie opened 1 year ago
When running
elm-codegen init
on Windows, everything works fine. It generates a path with correctly escaped backslashes into elm.codegen.json.
elm.codegen.json
However, when a Unix-style path are included (E.g. change in the generated file codegen\\helpers\\ to codegen/helpers/), the path is silently ignored.
codegen\\helpers\\
codegen/helpers/
This can be seen by deleting codegen/Gen and running elm-codegen install. After that, codegen/Gen/Helper.elm is missing.
codegen/Gen
elm-codegen install
codegen/Gen/Helper.elm
The main issue is: On Windows, a path like codegen/helpers/ should be interpreted as codegen\\helpers\\.
Less important: elm-codegen init should write codegen/helpers/ into elm.codegen.json.
This issue was discovered together with @dillonkearns.
I've run into Windows path issues like this in Node. In the past, the fix for me has been to make changes like
someFilePath.split('/') -> someFilePath.split(path.sep)
someFilePath.split('/')
someFilePath.split(path.sep)
When running
on Windows, everything works fine. It generates a path with correctly escaped backslashes into
elm.codegen.json
.However, when a Unix-style path are included (E.g. change in the generated file
codegen\\helpers\\
tocodegen/helpers/
), the path is silently ignored.This can be seen by deleting
codegen/Gen
and runningelm-codegen install
. After that,codegen/Gen/Helper.elm
is missing.The main issue is: On Windows, a path like
codegen/helpers/
should be interpreted ascodegen\\helpers\\
.Less important:
elm-codegen init
should writecodegen/helpers/
intoelm.codegen.json
.This issue was discovered together with @dillonkearns.