(ctx context.Context, command string, args []string, dir string, config config.Config, dependencies []types.Dependency)
| 84 | } |
| 85 | |
| 86 | func 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 | } |
no test coverage detected