Skip to content

Commit 4f0f33c

Browse files
CybotTMclaude
andcommitted
refactor(detection): move entr to catalog, remove docker-compose legacy support
- Add version_command to entr.json catalog (reads from stderr) - Create docker-compose.json catalog with version_command for plugin detection - Remove entr hardcoded special case from detection.py (now catalog-driven) - Remove docker-compose hardcoded special case (legacy binary no longer supported) - Update docker-compose tool to only search for "docker" binary (plugin form only) Modern Docker Compose v2 is a plugin for Docker CLI. The legacy standalone docker-compose binary is no longer supported. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 357ae39 commit 4f0f33c

4 files changed

Lines changed: 13 additions & 36 deletions

File tree

catalog/docker-compose.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "docker-compose",
3+
"install_method": "dedicated_script",
4+
"description": "Docker Compose - tool for defining multi-container applications",
5+
"homepage": "https://docs.docker.com/compose/",
6+
"github_repo": "docker/compose",
7+
"binary_name": "docker",
8+
"version_command": "docker compose version 2>&1 | head -1",
9+
"script": "install_docker.sh",
10+
"notes": "Modern Docker Compose v2 is a plugin for Docker CLI. Legacy standalone docker-compose binary is no longer supported."
11+
}

catalog/entr.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"install_method": "package_manager",
44
"description": "Run arbitrary commands when files change",
55
"homepage": "http://eradman.com/entrproject/",
6+
"version_command": "entr 2>&1 | grep 'release:' | head -1",
67
"package_managers": {
78
"apt": "entr",
89
"dnf": "entr",

cli_audit/detection.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -187,41 +187,6 @@ def get_version_line(path: str, tool_name: str, version_flag: str | None = None,
187187
# sponge reads stdin and can block - catalog has version_command to query dpkg
188188
return "installed"
189189

190-
if tool_name == "docker-compose":
191-
base = os.path.basename(path)
192-
if base == "docker":
193-
# Plugin form
194-
line = run_with_timeout([path, "compose", "version"])
195-
if line:
196-
return line
197-
# Legacy binary
198-
line = run_with_timeout([path, "version"])
199-
if line:
200-
return line
201-
202-
if tool_name == "entr":
203-
# entr shows version in stderr when run with no args
204-
try:
205-
proc = subprocess.run(
206-
[path],
207-
stdout=subprocess.PIPE,
208-
stderr=subprocess.PIPE,
209-
stdin=subprocess.DEVNULL,
210-
text=True,
211-
timeout=0.5,
212-
check=False,
213-
env={**os.environ, "TERM": "dumb"},
214-
)
215-
# Version is in stderr: "release: 5.7"
216-
stderr = proc.stderr or ""
217-
for line in stderr.splitlines():
218-
line = ANSI_ESCAPE_RE.sub('', line.strip())
219-
if line.startswith("release:"):
220-
return line
221-
except Exception:
222-
pass
223-
224-
225190
if tool_name == "fx":
226191
# fx is a Node.js tool with no --version flag
227192
# Try to read version from package.json

cli_audit/tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class Tool:
100100
Tool("kubectl", ("kubectl",), "gh", ("kubernetes", "kubernetes"), "cloud-infra", "make install-kubectl"),
101101
Tool("terraform", ("terraform",), "gh", ("hashicorp", "terraform"), "cloud-infra", "make install-terraform"),
102102
Tool("docker", ("docker",), "gh", ("docker", "cli"), "cloud-infra", "make install-docker"),
103-
Tool("docker-compose", ("docker-compose", "docker"), "gh", ("docker", "compose"), "cloud-infra", "make install-docker"),
103+
Tool("docker-compose", ("docker",), "gh", ("docker", "compose"), "cloud-infra", "make install-docker"),
104104
)
105105

106106
# Tool lookup map for fast access

0 commit comments

Comments
 (0)