feat(build): simplify some internal tooling.

This commit is contained in:
Alexandre Pujol 2024-04-02 17:48:03 +01:00
parent 791459e39a
commit 1915fa5175
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
14 changed files with 140 additions and 121 deletions

View file

@ -33,7 +33,7 @@ func init() {
Base: cfg.Base{
Keyword: "stack",
Msg: "Stack directive applied",
Help: `#aa:stack profiles...`,
Help: Keyword + `stack profiles...`,
},
})
}
@ -41,12 +41,7 @@ func init() {
func (s Stack) Apply(opt *Option, profile string) string {
res := ""
for name := range opt.ArgMap {
tmp, err := cfg.RootApparmord.Join(name).ReadFile()
if err != nil {
panic(err)
}
stackedProfile := string(tmp)
stackedProfile := util.MustReadFile(cfg.RootApparmord.Join(name))
m := regRules.FindStringSubmatch(stackedProfile)
if len(m) < 2 {
panic(fmt.Sprintf("No profile found in %s", name))