mirror of
https://github.com/Kir-Antipov/mc-publish.git
synced 2024-11-22 00:11:02 -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: [],
|
||||
...data,
|
||||
mod_id: id,
|
||||
file_parts: files.map(x => x.name)
|
||||
file_parts: files.map((_, i) => i.toString())
|
||||
};
|
||||
|
||||
const form = new FormData();
|
||||
form.append("data", JSON.stringify(data));
|
||||
for (const file of files) {
|
||||
form.append(file.name, await fileFromPath(file.path), file.name);
|
||||
for (let i = 0; i < files.length; ++i) {
|
||||
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", {
|
||||
|
|
Loading…
Reference in a new issue