Skip to content

Commit

Permalink
Add support for Windows
Browse files Browse the repository at this point in the history
`elmPathToModuleName` assumes a path separator of `/`, but windows uses `\`. 

This changes to using `.split(path.sep).join(".")` instead of a regexp replace, so that any platform will use the proper path separator
  • Loading branch information
kageurufu authored Mar 19, 2024
1 parent 1ae8c04 commit 2bc6600
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/cli-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function findParentElmJson(p) {
}

function elmPathToModuleName(pathName) {
return pathName.slice(0, -4).replace(/\//g, ".");
return pathName.slice(0, -4).split(path.sep).join(".");
}

module.exports = {
Expand Down

0 comments on commit 2bc6600

Please sign in to comment.