Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/renderer/lib/containers/docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,14 @@ export class DockerContainer extends ContainerManager {
if (dockerComposeOutput) {
// Example output: "Docker Compose version v2.35.1"
// Example output 2: "Docker Compose version 2.36.2"
// Example output 3: "Docker Compose version dev"
const versionMatch = /(\d+\.\d+\.\d+)/.exec(dockerComposeOutput);
if (versionMatch) {
const majorVersion = Number.parseInt(versionMatch[1].split(".")[0], 10);
specs.dockerComposeInstalled = majorVersion >= 2;
} else if (dockerComposeOutput.includes("dev")) {
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check dockerComposeOutput.includes("dev") is too broad and could produce false positives. For example, it would match "Docker Compose version 2.35.1 - developer edition" or any output containing the substring "dev" anywhere. Consider using a more specific pattern like /version\s+(dev|v?dev)\b/i.test(dockerComposeOutput) to match "dev" only when it appears as a standalone version string.

Suggested change
} else if (dockerComposeOutput.includes("dev")) {
} else if (/version\s+(dev|v?dev)\b/i.test(dockerComposeOutput)) {

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think checking for dev itself is fine, though I'm more than fine with changing that if need be.

Copy link
Owner

@TibixDev TibixDev Jan 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do .endsWith perhaps and see if that still works? Would be a bit cleaner.

// Development builds are assumed to be v2+
specs.dockerComposeInstalled = true;
} else {
specs.dockerComposeInstalled = false; // No valid version found
}
Expand Down