WriteCommand prints the working directory, the environment variables, and 'cf' with the given arguments. Environment variables that are passwords will be redacted.
(workingDir string, env map[string]string, args []string)
| 102 | // 'cf' with the given arguments. Environment variables that are passwords will |
| 103 | // be redacted. |
| 104 | func WriteCommand(workingDir string, env map[string]string, args []string) { |
| 105 | start := DebugCommandPrefix |
| 106 | if workingDir != "" { |
| 107 | start = fmt.Sprintf(DebugCommandPrefixWithDir, workingDir) |
| 108 | } |
| 109 | |
| 110 | display := []string{ |
| 111 | start, |
| 112 | } |
| 113 | |
| 114 | for key, val := range env { |
| 115 | if isPass.MatchString(key) { |
| 116 | val = "*****" |
| 117 | } |
| 118 | display = append(display, fmt.Sprintf("%s=%s", key, val)) |
| 119 | } |
| 120 | |
| 121 | display = append(display, "cf") |
| 122 | display = append(display, args...) |
| 123 | GinkgoWriter.Write([]byte(strings.Join(append(display, "\n"), " "))) |
| 124 | } |
no test coverage detected