File tree Expand file tree Collapse file tree 1 file changed +3
-18
lines changed Expand file tree Collapse file tree 1 file changed +3
-18
lines changed Original file line number Diff line number Diff line change @@ -57,27 +57,12 @@ func DownloadExecutionLogsTool(config *config.Config, client *client.LogService)
57
57
return mcp .NewToolResultError (err .Error ()), nil
58
58
}
59
59
60
- // Check if logs directory exists, if not create it
61
- _ , err = os .Stat (logsDirectory )
62
- if err != nil {
63
- // Directory does not exist, create it
64
- if os .IsNotExist (err ) {
65
- createErr := os .Mkdir (logsDirectory , 0755 )
66
- if createErr != nil {
67
- return mcp .NewToolResultError (createErr .Error ()), nil
68
- }
69
- } else {
70
- return mcp .NewToolResultError (err .Error ()), nil
71
- }
72
- }
73
-
74
- // Create the logs folder with plan execution ID
60
+ // Create the logs folder path (creates all parent directories if needed)
75
61
logsFolderName := fmt .Sprintf ("logs-%s" , planExecutionID )
76
62
logsFolderPath := filepath .Join (logsDirectory , logsFolderName )
77
-
78
- err = os .Mkdir (logsFolderPath , 0755 )
63
+ err = os .MkdirAll (logsFolderPath , 0755 )
79
64
if err != nil {
80
- return mcp .NewToolResultError (fmt .Sprintf ("failed to create logs folder : %v" , err )), nil
65
+ return mcp .NewToolResultError (fmt .Sprintf ("failed to create logs directory : %v" , err )), nil
81
66
}
82
67
83
68
// Get the download URL
You can’t perform that action at this time.
0 commit comments