MCPcopy Index your code
hub / github.com/devspace-sh/devspace / printExtraInfo

Function printExtraInfo

cmd/print.go:186–219  ·  view source on GitHub ↗
(config config.Config, dependencies []types.Dependency, log logger.Logger)

Source from the content-addressed store, hash-verified

184}
185
186func printExtraInfo(config config.Config, dependencies []types.Dependency, log logger.Logger) error {
187 log.WriteString(logrus.InfoLevel, "\n-------------------\n\nVars:\n")
188
189 headerColumnNames := []string{"Name", "Value"}
190 values := [][]string{}
191 resolvedVars := config.Variables()
192 for varName, varValue := range resolvedVars {
193 values = append(values, []string{
194 varName,
195 fmt.Sprintf("%v", varValue),
196 })
197 }
198 sort.Slice(values, func(i, j int) bool {
199 return values[i][0] < values[j][0]
200 })
201
202 if len(values) > 0 {
203 logger.PrintTable(log, headerColumnNames, values)
204 } else {
205 log.Info("No vars found")
206 }
207
208 log.WriteString(logrus.InfoLevel, "\n-------------------\n\nLoaded path: "+config.Path()+"\n\n-------------------\n\n")
209
210 if len(dependencies) > 0 {
211 log.WriteString(logrus.InfoLevel, "Dependency Tree:\n\n> Root\n")
212 for _, dep := range dependencies {
213 printDependencyRecursive("--", dep, 5, log)
214 }
215 log.WriteString(logrus.InfoLevel, "\n-------------------\n\n")
216 }
217
218 return nil
219}
220
221func printDependencyRecursive(prefix string, dep types.Dependency, maxDepth int, log logger.Logger) {
222 if maxDepth == 0 {

Callers 1

RunMethod · 0.85

Calls 5

printDependencyRecursiveFunction · 0.85
WriteStringMethod · 0.65
VariablesMethod · 0.65
PathMethod · 0.65
InfoMethod · 0.45

Tested by

no test coverage detected