Skip to content

Commit 73c92c2

Browse files
committed
feat: add edit file method
1 parent 010e8b9 commit 73c92c2

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.changeset/cyan-zoos-smash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@squarecloud/api": minor
3+
---
4+
5+
New `Application#files#edit` method for editing files

src/managers/application/files.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,17 @@ export class ApplicationFilesManager {
6969
return status === "success";
7070
}
7171

72+
/**
73+
* Edits an existing file (same as create)
74+
*
75+
* @param file - The file content
76+
* @param fileName - The file name with extension
77+
* @param path - The absolute file path
78+
*/
79+
async edit(file: string | Buffer, path = "/") {
80+
return this.create(file, "", path);
81+
}
82+
7283
/**
7384
* Deletes the specified file or directory
7485
*

0 commit comments

Comments
 (0)