mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 23:33:12 +09:00
Automatically upload export to master server
Upload the created export data zip file to a new /api/upload-export endpoint on the master server which unpacks it into the appropriate directory on the master.
This commit is contained in:
1 parent
f3d4cfdcf5
commit
36cf14074e
5 files changed
+62
-4
No files matched your search
@@ -306,6 +306,7 @@ async function exportLocale(server, modVersions, modOrder, languageCode) {
|
||||
*
|
||||
* @param {module:lib/factorio.FactorioServer} server -
|
||||
* The server to export the data from.
|
||||
* @returns {JSZip} zip file with exported data.
|
||||
* @memberof module:lib/factorio
|
||||
*/
|
||||
async function exportData(server) {
|
||||
@@ -347,8 +348,7 @@ async function exportData(server) {
|
||||
zip.file("export/item-spritesheet.png", await iconSheet.getBufferAsync(Jimp.MIME_PNG));
|
||||
zip.file("export/item-metadata.json", JSON.stringify([...itemData.entries()]));
|
||||
zip.file("export/locale.json", JSON.stringify([...locale.entries()]));
|
||||
let content = await zip.generateAsync({ type: "nodebuffer" });
|
||||
await fs.outputFile("temp/export.zip", content);
|
||||
return zip;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user