Compare commits

...

3 Commits

Author SHA1 Message Date
github-actions[bot]
7c7ceca264 Update version to v1.4.234 and commit 2025-07-06 09:00:46 +00:00
Kayvan Sylvan
c19d7ccd9d Merge pull request #1581 from ksylvan/0705-custom-directory-creation-bug
Fix Custom Patterns Directory Creation Logic
2025-07-06 01:59:19 -07:00
Kayvan Sylvan
bd0c5f730e chore: improve directory creation logic in configure method
### CHANGES

- Add `fmt` package for logging errors
- Check directory existence before creating
- Log error without clearing directory value
2025-07-06 01:55:18 -07:00
3 changed files with 9 additions and 6 deletions

View File

@@ -1 +1 @@
"1.4.233"
"1.4.234"

View File

@@ -1,6 +1,7 @@
package custom_patterns
import (
"fmt"
"os"
"path/filepath"
"strings"
@@ -44,10 +45,12 @@ func (o *CustomPatterns) configure() error {
o.CustomPatternsDir.Value = absPath
}
// Create the directory if it doesn't exist
if err := os.MkdirAll(o.CustomPatternsDir.Value, 0755); err != nil {
// If we can't create it, clear the value to avoid errors
o.CustomPatternsDir.Value = ""
// Check if directory exists, create only if it doesn't
if _, err := os.Stat(o.CustomPatternsDir.Value); os.IsNotExist(err) {
if err := os.MkdirAll(o.CustomPatternsDir.Value, 0755); err != nil {
// Log the error but don't clear the value - let it persist in env file
fmt.Printf("Warning: Could not create custom patterns directory %s: %v\n", o.CustomPatternsDir.Value, err)
}
}
}

View File

@@ -1,3 +1,3 @@
package main
var version = "v1.4.233"
var version = "v1.4.234"