Skip to content

Commit f963a2e

Browse files
committed
refactor(cucumbertemplate): cleaner functionality for getting the path for a file
1 parent 8866ba3 commit f963a2e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/cucumberTemplate.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ const os = require("os");
33

44
const getPathFor = file => {
55
if (os.platform() === "win32") {
6-
const pathParts = __dirname.split("\\");
7-
return path.join(...pathParts, file).replace(/\\/g, "\\\\");
6+
return path
7+
.join(__dirname.replace(/\\/g, path.sep), file)
8+
.replace(/\\/g, path.sep);
89
}
910
return `${__dirname}/${file}`;
1011
};

0 commit comments

Comments
 (0)