mercury-agent 0.4.19 → 0.4.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -394,8 +394,34 @@ function isDockerDesktop(): boolean {
|
|
|
394
394
|
timeout: 10_000,
|
|
395
395
|
stdio: ["pipe", "pipe", "pipe"],
|
|
396
396
|
});
|
|
397
|
-
const
|
|
398
|
-
|
|
397
|
+
const name = (result.stdout ?? "").trim();
|
|
398
|
+
const stderr = (result.stderr ?? "").trim();
|
|
399
|
+
if (name === "docker-desktop") {
|
|
400
|
+
_isDockerDesktop = true;
|
|
401
|
+
} else {
|
|
402
|
+
// Fallback: check Docker context or server OS for Docker Desktop indicators
|
|
403
|
+
const ctxResult = spawnSync(
|
|
404
|
+
"docker",
|
|
405
|
+
["info", "--format", "{{.OperatingSystem}}"],
|
|
406
|
+
{ encoding: "utf8", timeout: 10_000, stdio: ["pipe", "pipe", "pipe"] },
|
|
407
|
+
);
|
|
408
|
+
const os = (ctxResult.stdout ?? "").trim();
|
|
409
|
+
_isDockerDesktop =
|
|
410
|
+
os.includes("Docker Desktop") || os.includes("Docker for Windows");
|
|
411
|
+
if (_isDockerDesktop) {
|
|
412
|
+
logger.info("Docker Desktop detected via OperatingSystem field", {
|
|
413
|
+
name,
|
|
414
|
+
os,
|
|
415
|
+
});
|
|
416
|
+
} else {
|
|
417
|
+
logger.debug("Docker Desktop not detected", {
|
|
418
|
+
name,
|
|
419
|
+
os,
|
|
420
|
+
exitCode: result.status,
|
|
421
|
+
stderr: stderr.slice(0, 200),
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
}
|
|
399
425
|
} catch {
|
|
400
426
|
_isDockerDesktop = false;
|
|
401
427
|
}
|