-
-
Notifications
You must be signed in to change notification settings - Fork 844
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
fix: Fix the issue with ineffective --build.full_bin command line argument #748
Conversation
Codecov ReportAttention: Patch coverage is
|
runner/config.go
Outdated
@@ -394,4 +394,12 @@ func (c *Config) WithArgs(args map[string]TomlInfo) { | |||
setValue2Struct(v, value.fieldPath, *value.Value) | |||
} | |||
} | |||
|
|||
if len(c.Build.FullBin) > 0 { |
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.
logic duplicated
Lines 324 to 331 in ad8fbb7
c.Build.ExcludeDir = ed | |
if len(c.Build.FullBin) > 0 { | |
c.Build.Bin = c.Build.FullBin | |
return err | |
} | |
// Fix windows CMD processor | |
// CMD will not recognize relative path like ./tmp/server | |
c.Build.Bin, err = filepath.Abs(c.Build.Bin) |
can we just extract Lines 324 to 331 in ad8fbb7
Line 97 in ad8fbb7
|
假如我像上面那样修改,PostProcess的功能仅是对c.Build.FullBin和filepath.Abs的简单封装,会给cfg增加额外的对外接口,增加使用复杂度,就不符合KISS原则了 |
sorry i need to write in English, cause there are contributors all around the world. and i made WithArgs private, and hide logic in preprocess function. i think this way should be better. |
…ument (air-verse#748) * Update config.go * Update flag_test.go * fix: handle preprocess correctly in command line arguments * fix: update withArgs documentation to reflect its private status --------- Co-authored-by: xiantang <zhujingdi1998@gmail.com>
No description provided.