diff --git a/gulpfile.js b/gulpfile.js index ab5de4c..c9095db 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -259,7 +259,7 @@ async function uploadToPackageRegistry(done) { /* Publish to FoundryVTT /* ----------------------------------------- */ -function publishToFoundry(done) { +async function publishToFoundry(done) { const moduleManifestPath = 'system.json'; const moduleManifest = JSON.parse(fs.readFileSync(moduleManifestPath)); @@ -299,7 +299,7 @@ function publishToFoundry(done) { } // Send the POST request to Foundry VTT API - const response = fetch('https://api.foundryvtt.com/_api/packages/release', { + const response = await fetch('https://api.foundryvtt.com/_api/packages/release', { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -308,7 +308,7 @@ function publishToFoundry(done) { body: JSON.stringify(payload), }); - const responseData = response.json(); + const responseData = await response.json(); if (responseData.status === 'success') { console.log('Successfully published to Foundry VTT:');