Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove most calls to com, improve vars.Expand #22

Closed

Conversation

wxiaoguang
Copy link
Collaborator

No description provided.

log.Error(err.Error())
return
// here we could just log the error and continue the rendering
log.Error("unable to expand template vars for ref %s, err:%s", ref.Issue, err.Error())
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But res here is empty?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it always has content. See the Expand unit test.

@@ -62,7 +62,8 @@ func prepareRepoCommit(ctx context.Context, repo *repo_model.Repository, tmpDir,
}
res, err := vars.Expand(string(data), match)
if err != nil {
return fmt.Errorf("expand README.md: %v", err)
// here we could just log the error and continue the rendering
log.Error("unable to expand template vars for repo README: %s, err: %s", opts.Readme, err.Error())
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that meaningful to write an empty to the file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it always has content. See the Expand unit test.

@wxiaoguang wxiaoguang force-pushed the lunny/vars_expand branch 2 times, most recently from d1d1708 to 73602a2 Compare April 1, 2022 04:55
@wxiaoguang wxiaoguang closed this Apr 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants