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

@ -13,6 +13,7 @@ import (
"github.com/roddhjav/apparmor.d/pkg/prebuild/cfg"
"github.com/roddhjav/apparmor.d/pkg/prebuild/directive"
"github.com/roddhjav/apparmor.d/pkg/prebuild/prepare"
"github.com/roddhjav/apparmor.d/pkg/util"
)
func init() {
@ -65,11 +66,10 @@ func Build() error {
if !file.Exist() {
continue
}
content, err := file.ReadFile()
profile, err := util.ReadFile(file)
if err != nil {
return err
}
profile := string(content)
for _, b := range builder.Builds {
profile = b.Apply(profile)
}