Fix test gateway Windows config paths
This commit is contained in:
@@ -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 = "") {
|
||||
|
||||
Reference in New Issue
Block a user