MCPcopy Create free account
hub / github.com/openshift/origin / ValidateGodeps

Function ValidateGodeps

tools/rebasehelpers/commitchecker/validate.go:183–203  ·  view source on GitHub ↗

ValidateGodeps invokes hack/godep-restore.sh whenever it finds at least one commit modifying Godeps/Godeps.json file or vendor/ directory.

(commits []util.Commit)

Source from the content-addressed store, hash-verified

181// ValidateGodeps invokes hack/godep-restore.sh whenever it finds at least one commit
182// modifying Godeps/Godeps.json file or vendor/ directory.
183func ValidateGodeps(commits []util.Commit) error {
184 runGodepsRestore := false
185 for _, commit := range commits {
186 if commit.HasVendoredCodeChanges() || commit.HasGodepsChanges() {
187 runGodepsRestore = true
188 break
189 }
190 }
191 if runGodepsRestore {
192 fmt.Println("Running godep-restore")
193 cmd := exec.Command("hack/godep-restore.sh")
194 var stdout bytes.Buffer
195 var stderr bytes.Buffer
196 cmd.Stdout = &stdout
197 cmd.Stderr = &stderr
198 if err := cmd.Run(); err != nil {
199 return fmt.Errorf("Error running hack/godep-restore.sh: %v\n%s\n%s", err, stderr.String(), stdout.String())
200 }
201 }
202 return nil
203}
204
205type CommitFilesRenderOption int
206

Callers 1

mainFunction · 0.85

Calls 5

RunMethod · 0.65
StringMethod · 0.65
HasGodepsChangesMethod · 0.45
CommandMethod · 0.45

Tested by

no test coverage detected