Skip to content

Commit dbca1f8

Browse files
committed
fix incorrect file path at files#create
1 parent 209ba65 commit dbca1f8

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.changeset/violet-tools-shake.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@squarecloud/api": patch
3+
---
4+
5+
Fix incorrect file path at `FilesManager#create`

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/managers/application/files.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,13 @@ export class ApplicationFilesManager {
4949
if (typeof file === "string") {
5050
file = await readFile(file);
5151
}
52+
path = join(path, fileName).replaceAll("\\", "/");
5253

5354
const { status } = await this.application.client.api.application("files/create", this.application.id, undefined, {
5455
method: "POST",
5556
body: JSON.stringify({
5657
buffer: file.toJSON(),
57-
path: join(path, fileName),
58+
path,
5859
}),
5960
});
6061

0 commit comments

Comments
 (0)