Fix test gateway Windows config paths

This commit is contained in:
Jeppe B
2026-05-28 19:00:31 +02:00
parent 893ed1bda5
commit 4d91fc8ead
+12 -2
View File
@@ -73,12 +73,22 @@ export function resolveComposeNetworkName(rootDir, env = process.env) {
return `${resolveComposeProjectName(rootDir, env)}_default`;
}
function usesWindowsPathSyntax(filePath) {
return /^[A-Za-z]:[\\/]/.test(filePath) || filePath.startsWith("\\\\");
}
function pathForInputs(...filePaths) {
return filePaths.some((filePath) => usesWindowsPathSyntax(String(filePath || ""))) ? path.win32 : path;
}
export function resolveConfigDirectory(rootDir, explicitDir = null) {
const pathModule = pathForInputs(rootDir, explicitDir);
if (explicitDir) {
return path.resolve(rootDir, explicitDir);
return pathModule.resolve(rootDir, explicitDir);
}
return path.join(rootDir, ".tmp", "test-gateway");
return pathModule.join(rootDir, ".tmp", "test-gateway");
}
export function shouldClaimGateway(existingConfig = {}, installToken = "") {