Skip to content
This repository has been archived by the owner on Jun 17, 2023. It is now read-only.

Commit

Permalink
Merge pull request #4 from cadencerpm/sammauldin/intermittent-failure…
Browse files Browse the repository at this point in the history
…-testing

Remove possibility of race condition during build
  • Loading branch information
SamMauldin authored Mar 16, 2023
2 parents a50174b + 161f6d9 commit 3da167e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion rules/private/list_repository_tools_srcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,16 @@ func main() {
fmt.Fprintln(buf, "]")

if *generate != "" {
if err := ioutil.WriteFile(*generate, buf.Bytes(), 0666); err != nil {
got, err := ioutil.ReadFile(*generate)
if err != nil {
log.Fatal(err)
}

if !bytes.Equal(got, buf.Bytes()) {
if err := ioutil.WriteFile(*generate, buf.Bytes(), 0666); err != nil {
log.Fatal(err)
}
}
} else {
got, err := ioutil.ReadFile(*check)
if err != nil {
Expand Down

0 comments on commit 3da167e

Please sign in to comment.