build: remove directive text not applied on build.
This commit is contained in:
parent
2aa8986a21
commit
c7fb47e97a
3 changed files with 11 additions and 4 deletions
|
|
@ -61,6 +61,13 @@ func NewOption(file *paths.Path, match []string) *Option {
|
|||
}
|
||||
}
|
||||
|
||||
// Clean the selected directive from profile.
|
||||
// Useful to remove directive text applied on some condition only
|
||||
func (o *Option) Clean(profile string) string {
|
||||
reg := regexp.MustCompile(`\s*` + Keyword + o.Name + ` .*$`)
|
||||
return reg.ReplaceAllString(profile, "")
|
||||
}
|
||||
|
||||
func RegisterDirective(d Directive) {
|
||||
Directives[d.Name()] = d
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue