Skip to content

Commit 54c7d3a

Browse files
committed
fix: Only install needed runtimes PLUTO-1384
1 parent 51e71a3 commit 54c7d3a

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ go.work.sum
2525
.vscode/
2626

2727
# Codacy CLI
28-
cli-v2
28+
cli-v2
29+
codacy-cli

cmd/init.go

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ func configFileTemplate(tools []tools.Tool) string {
135135
toolsMap := make(map[string]bool)
136136
toolVersions := make(map[string]string)
137137

138+
// Track needed runtimes
139+
needsNode := false
140+
needsPython := false
141+
138142
// Default versions
139143
defaultVersions := map[string]string{
140144
ESLint: "9.3.0",
@@ -151,13 +155,33 @@ func configFileTemplate(tools []tools.Tool) string {
151155
} else {
152156
toolVersions[tool.Uuid] = defaultVersions[tool.Uuid]
153157
}
158+
159+
// Check if tool needs a runtime
160+
if tool.Uuid == ESLint {
161+
needsNode = true
162+
} else if tool.Uuid == PyLint {
163+
needsPython = true
164+
}
154165
}
155166

156167
// Start building the YAML content
157168
var sb strings.Builder
158169
sb.WriteString("runtimes:\n")
159-
sb.WriteString(" - [email protected]\n")
160-
sb.WriteString(" - [email protected]\n")
170+
171+
// Only include runtimes needed by the enabled tools
172+
if len(tools) > 0 {
173+
if needsNode {
174+
sb.WriteString(" - [email protected]\n")
175+
}
176+
if needsPython {
177+
sb.WriteString(" - [email protected]\n")
178+
}
179+
} else {
180+
// In local mode with no tools specified, include all runtimes
181+
sb.WriteString(" - [email protected]\n")
182+
sb.WriteString(" - [email protected]\n")
183+
}
184+
161185
sb.WriteString("tools:\n")
162186

163187
// If we have tools from the API (enabled tools), use only those

0 commit comments

Comments
 (0)