mirror of
https://github.com/Kir-Antipov/mc-publish.git
synced 2024-11-25 09:51:01 -05:00
Fixed Modrinth's primary file detection
This commit is contained in:
parent
b3b5a975fb
commit
89b49fca88
1 changed files with 4 additions and 3 deletions
|
@ -8,13 +8,14 @@ export async function createVersion(id: string, data: Record<string, any>, files
|
||||||
dependencies: [],
|
dependencies: [],
|
||||||
...data,
|
...data,
|
||||||
mod_id: id,
|
mod_id: id,
|
||||||
file_parts: files.map(x => x.name)
|
file_parts: files.map((_, i) => i.toString())
|
||||||
};
|
};
|
||||||
|
|
||||||
const form = new FormData();
|
const form = new FormData();
|
||||||
form.append("data", JSON.stringify(data));
|
form.append("data", JSON.stringify(data));
|
||||||
for (const file of files) {
|
for (let i = 0; i < files.length; ++i) {
|
||||||
form.append(file.name, await fileFromPath(file.path), file.name);
|
const file = files[i];
|
||||||
|
form.append(i.toString(), await fileFromPath(file.path), file.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await fetch("https://api.modrinth.com/api/v1/version", {
|
const response = await fetch("https://api.modrinth.com/api/v1/version", {
|
||||||
|
|
Loading…
Reference in a new issue