You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: app/Tools/UpdateFile.php
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -4,11 +4,12 @@
4
4
5
5
useApp\Attributes\Description;
6
6
useIlluminate\Support\Facades\Storage;
7
+
7
8
usefunctionTermwind\render;
8
9
9
10
#[Description('Update the content of an existing file at the specified path. Use this when you need to update the existing of a file after write_to_file returns a suggestion to merge the content.')]
10
-
finalclass UpdateFile {
11
-
11
+
finalclass UpdateFile
12
+
{
12
13
publicfunctionhandle(
13
14
#[Description('File path to write content to')]
14
15
string$file_path,
@@ -25,10 +26,10 @@ public function handle(
25
26
$directory = dirname($file_path);
26
27
27
28
// Ensure the directory exists
28
-
if (!Storage::exists($directory)) {
29
+
if (!Storage::exists($directory)) {
29
30
render(view('tool', [
30
31
'name' => 'WriteToFile',
31
-
'output' => 'Directory not found. Creating '.$directory,
32
+
'output' => 'Directory not found. Creating '.$directory,
Copy file name to clipboardExpand all lines: app/Tools/WriteToFile.php
+6-5Lines changed: 6 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -4,11 +4,12 @@
4
4
5
5
useApp\Attributes\Description;
6
6
useIlluminate\Support\Facades\Storage;
7
+
7
8
usefunctionTermwind\render;
8
9
9
10
#[Description('Write content to an existing file at the specified path. Use this when you need to write content to a file.')]
10
-
finalclass WriteToFile {
11
-
11
+
finalclass WriteToFile
12
+
{
12
13
publicfunctionhandle(
13
14
#[Description('Relative File path to write content to')]
14
15
string$file_path,
@@ -30,14 +31,15 @@ public function handle(
30
31
'name' => 'WriteToFile',
31
32
'output' => 'The file already exists in the path, attempting to merge....',
32
33
]));
34
+
33
35
// Append the new content to the file
34
-
return'The file already exists in the path, Make sure to merge your suggestion with the existing file without any breaking changes. Once, they are merged, call the update_file function. The current contents of the file are '.$fileContent;
36
+
return'The file already exists in the path, Make sure to merge your suggestion with the existing file without any breaking changes. Once, they are merged, call the update_file function. The current contents of the file are '.$fileContent;
0 commit comments