build: add the X option to the stack directive.
This commit is contained in:
parent
67c5181ba9
commit
f3094cc741
6 changed files with 30 additions and 8 deletions
|
|
@ -14,7 +14,7 @@ import (
|
|||
|
||||
var (
|
||||
regFlags = regexp.MustCompile(`flags=\(([^)]+)\)`)
|
||||
regProfileHeader = regexp.MustCompile(` {`)
|
||||
regProfileHeader = regexp.MustCompile(` {\n`)
|
||||
)
|
||||
|
||||
type Complain struct {
|
||||
|
|
@ -40,7 +40,7 @@ func (b Complain) Apply(opt *Option, profile string) (string, error) {
|
|||
}
|
||||
}
|
||||
flags = append(flags, "complain")
|
||||
strFlags := " flags=(" + strings.Join(flags, ",") + ") {"
|
||||
strFlags := " flags=(" + strings.Join(flags, ",") + ") {\n"
|
||||
|
||||
// Remove all flags definition, then set manifest' flags
|
||||
profile = regFlags.ReplaceAllLiteralString(profile, "")
|
||||
|
|
|
|||
|
|
@ -36,9 +36,9 @@ func (b Enforce) Apply(opt *Option, profile string) (string, error) {
|
|||
return profile, nil
|
||||
}
|
||||
flags = slices.Delete(flags, idx, idx+1)
|
||||
strFlags := "{"
|
||||
strFlags := "{\n"
|
||||
if len(flags) >= 1 {
|
||||
strFlags = " flags=(" + strings.Join(flags, ",") + ") {"
|
||||
strFlags = " flags=(" + strings.Join(flags, ",") + ") {\n"
|
||||
}
|
||||
|
||||
// Remove all flags definition, then set new flags
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue