Skip to content

Commit

Permalink
fix: improve reliability of the template post-clone script
Browse files Browse the repository at this point in the history
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
  • Loading branch information
moul committed Jul 28, 2021
1 parent c06bad4 commit d64b4a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion template-post-clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ func doTemplatePostCloneOnce(_ context.Context, path string) error {
return fmt.Errorf("read Makefile: %w", err)
}
content = regexp.MustCompile(`(?m)^(DOCKER_IMAGE|GOBINS|NPM_PACKAGES) .=.*\n`).ReplaceAll(content, []byte(""))
content = regexp.MustCompile(`(?ms)^generate:.*.PHONY: generate\n\n`).ReplaceAll(content, []byte(""))
content = regexp.MustCompile(`(?ms)^generate:.*.PHONY: generate`).ReplaceAll(content, []byte(""))
content = regexp.MustCompile(`(?ms)^\n\n\n\n`).ReplaceAll(content, []byte("\n\n"))
err = ioutil.WriteFile(path, content, 0)
if err != nil {
return fmt.Errorf("write file: %q: %w", path, err)
Expand Down

0 comments on commit d64b4a3

Please sign in to comment.