-
Notifications
You must be signed in to change notification settings - Fork 537
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
feat(hz): add append_direction into update_behavior #1071
base: develop
Are you sure you want to change the base?
Conversation
kevinzhang seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
感谢 pr,整体没啥问题,先签一个 CLA 吧~ |
cmd/hz/generator/custom_files.go
Outdated
@@ -555,7 +559,11 @@ func (pkgGen *HttpPackageGenerator) genSingleCustomizedFile(tplInfo *Template, f | |||
return fmt.Errorf("do not support multiple append location '%s' for file '%s'\n", tplInfo.UpdateBehavior.AppendLocation, filePath) | |||
} | |||
buf := bytes.NewBuffer(nil) | |||
err = writeBytes(buf, part[0], []byte(tplInfo.UpdateBehavior.AppendLocation), appendContent, part[1]) | |||
if tplInfo.UpdateBehavior.AppendDirection == "before" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以把 "before" 和 "after" 单独提出来成一个 const 吗? 整体来说没啥问题
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改,麻烦查看一下~
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #1071 +/- ##
===========================================
+ Coverage 82.79% 82.82% +0.02%
===========================================
Files 98 98
Lines 10032 10032
===========================================
+ Hits 8306 8309 +3
+ Misses 1236 1233 -3
Partials 490 490 ☔ View full report in Codecov by Sentry. |
What type of PR is this?
Check the PR title.
(Optional) Translate the PR title into Chinese.
添加
append_direction
选项到update_behavior
中(Optional) More detailed description for this PR(en: English/zh: Chinese).
en: Add the
append_direction
option toupdate_behavior
, which controls the position of newly added content relative to the insertion point (before
- in front of the insertion point;after
- behind the insertion point); default:after
.zh(optional): 添加
append_direction
选项到update_behavior
中,用于控制新增内容追加到插入点的位置(before
-在插入点前面;after
-在插入点后面;),默认:after
(Optional) Which issue(s) this PR fixes:
(Optional) The PR that updates user documentation: