fix: revert #1

This commit is contained in:
soulteary 2023-01-09 23:00:00 +08:00
parent 5a3828e4dd
commit 3285d30374
No known key found for this signature in database
GPG key ID: 8107DBA6BC84D986
3 changed files with 11 additions and 20 deletions

View file

@ -206,21 +206,20 @@ func main() {
newHooks := hook.Hooks{}
err := newHooks.LoadFromFile(hooksFilePath, *asTemplate)
if err != nil {
log.Fatalf("couldn't load hooks from file! %+v\n", err)
}
log.Printf("couldn't load hooks from file! %+v\n", err)
} else {
log.Printf("found %d hook(s) in file\n", len(newHooks))
log.Printf("found %d hook(s) in file\n", len(newHooks))
for _, hook := range newHooks {
if matchLoadedHook(hook.ID) != nil {
log.Fatalf("error: hook with the id %s has already been loaded!\nplease check your hooks file for duplicate hooks ids!\n", hook.ID)
for _, hook := range newHooks {
if matchLoadedHook(hook.ID) != nil {
log.Fatalf("error: hook with the id %s has already been loaded!\nplease check your hooks file for duplicate hooks ids!\n", hook.ID)
}
log.Printf("\tloaded: %s\n", hook.ID)
}
log.Printf("\tloaded: %s\n", hook.ID)
}
loadedHooksFromFiles[hooksFilePath] = newHooks
loadedHooksFromFiles[hooksFilePath] = newHooks
}
}
newHooksFiles := hooksFiles[:0]