Fix consts on Windows
@@ -3,13 +3,16 @@ import path from "path";
const isDist =
__dirname.endsWith("/dist") ||
__dirname.endsWith("/dist/windows") ||
- __dirname.endsWith("/dist/windows/help");
+ __dirname.endsWith("/dist/windows/help") ||
+ __dirname.endsWith("\\dist") ||
+ __dirname.endsWith("\\dist\\windows") ||
+ __dirname.endsWith("\\dist\\windows\\help");
const rootDir = isDist
? __dirname
- .replace(/\/dist\/windows\/help$/, "")
- .replace(/\/dist\/windows$/, "")
- .replace(/\/dist$/, "")
+ .replace(/[\\/]dist[\\/]windows[\\/]help$/, "")
+ .replace(/[\\/]dist[\\/]windows$/, "")
+ .replace(/[\\/]dist$/, "")
: path.normalize(__dirname + "/../");
const engineRoot = path.normalize(rootDir + "/data/src");
@@ -17,6 +20,6 @@ const buildToolsRoot = path.normalize(rootDir + "/buildTools");
const emulatorRoot = path.normalize(rootDir + "/data/js-emulator");
const projectTemplatesRoot = path.normalize(rootDir + "/data/templates");
-console.log({ __dirname, rootDir, engineRoot, buildToolsRoot, emulatorRoot });
+console.log({ __dirname, isDist, rootDir, engineRoot, buildToolsRoot, emulatorRoot, projectTemplatesRoot });
export { engineRoot, buildToolsRoot, emulatorRoot, projectTemplatesRoot };
