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

Function ResolveCommand

pkg/devspace/hook/local_command.go:86–109  ·  view source on GitHub ↗
(ctx context.Context, command string, args []string, dir string, config config.Config, dependencies []types.Dependency)

Source from the content-addressed store, hash-verified

84}
85
86func ResolveCommand(ctx context.Context, command string, args []string, dir string, config config.Config, dependencies []types.Dependency) (string, []string, error) {
87 // resolve hook command
88 hookCommand, err := runtimevar.NewRuntimeResolver(dir, true).FillRuntimeVariablesAsString(ctx, command, config, dependencies)
89 if err != nil {
90 return "", nil, errors.Wrap(err, "resolve image helpers")
91 }
92
93 // resolve args
94 if args != nil {
95 newArgs := []string{}
96 for _, a := range args {
97 newArg, err := runtimevar.NewRuntimeResolver(dir, true).FillRuntimeVariablesAsString(ctx, a, config, dependencies)
98 if err != nil {
99 return "", nil, errors.Wrap(err, "resolve image helpers")
100 }
101
102 newArgs = append(newArgs, newArg)
103 }
104
105 return hookCommand, newArgs, nil
106 }
107
108 return hookCommand, nil, nil
109}

Callers 3

initClientMethod · 0.92
ExecuteRemotelyMethod · 0.85
ExecuteMethod · 0.85

Calls 1

Tested by

no test coverage detected