From dd41369e057c38fca299ef3e12fb41c326a6564e Mon Sep 17 00:00:00 2001 From: EnumDev Date: Wed, 16 Apr 2025 18:49:54 +0300 Subject: [PATCH] Fix error when hooks directory does not exist --- src/bpmlib/operations.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bpmlib/operations.go b/src/bpmlib/operations.go index cb56419..f072759 100644 --- a/src/bpmlib/operations.go +++ b/src/bpmlib/operations.go @@ -379,6 +379,11 @@ func (operation *BPMOperation) ShowOperationSummary() { } func (operation *BPMOperation) RunHooks(verbose bool) error { + // Return if hooks directory does not exist + if stat, err := os.Stat(path.Join(operation.RootDir, "var/lib/bpm/hooks")); err != nil || !stat.IsDir() { + return nil + } + // Get directory entries in hooks directory dirEntries, err := os.ReadDir(path.Join(operation.RootDir, "var/lib/bpm/hooks")) if err != nil {