From 2bc6600fd85de56c77030cb9680a28583be28875 Mon Sep 17 00:00:00 2001 From: Frank Tackitt Date: Tue, 19 Mar 2024 12:16:58 -0700 Subject: [PATCH] Add support for Windows `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 --- bin/cli-helpers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cli-helpers.js b/bin/cli-helpers.js index 0e1595c..5cae9dc 100644 --- a/bin/cli-helpers.js +++ b/bin/cli-helpers.js @@ -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 = {