build: improve error handling.

This commit is contained in:
Alexandre Pujol 2024-03-10 14:24:59 +00:00
parent 166e786166
commit b342df689a
Failed to generate hash of commit

View file

@ -80,7 +80,10 @@ func Build() error {
if !file.Exist() { if !file.Exist() {
continue continue
} }
content, _ := file.ReadFile() content, err := file.ReadFile()
if err != nil {
return err
}
profile := string(content) profile := string(content)
for _, fct := range Builds { for _, fct := range Builds {
profile = fct(profile) profile = fct(profile)
@ -89,7 +92,7 @@ func Build() error {
profile = fct(file, profile) profile = fct(file, profile)
} }
if err := file.WriteFile([]byte(profile)); err != nil { if err := file.WriteFile([]byte(profile)); err != nil {
panic(err) return err
} }
} }
printBuildMessage() printBuildMessage()