File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
plugins/tools/custom_patterns Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 1
1
package custom_patterns
2
2
3
3
import (
4
+ "fmt"
4
5
"os"
5
6
"path/filepath"
6
7
"strings"
@@ -44,10 +45,12 @@ func (o *CustomPatterns) configure() error {
44
45
o .CustomPatternsDir .Value = absPath
45
46
}
46
47
47
- // Create the directory if it doesn't exist
48
- if err := os .MkdirAll (o .CustomPatternsDir .Value , 0755 ); err != nil {
49
- // If we can't create it, clear the value to avoid errors
50
- o .CustomPatternsDir .Value = ""
48
+ // Check if directory exists, create only if it doesn't
49
+ if _ , err := os .Stat (o .CustomPatternsDir .Value ); os .IsNotExist (err ) {
50
+ if err := os .MkdirAll (o .CustomPatternsDir .Value , 0755 ); err != nil {
51
+ // Log the error but don't clear the value - let it persist in env file
52
+ fmt .Printf ("Warning: Could not create custom patterns directory %s: %v\n " , o .CustomPatternsDir .Value , err )
53
+ }
51
54
}
52
55
}
53
56
You can’t perform that action at this time.
0 commit comments