mod-build 4.0.106-beta.2 → 4.0.106-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -107,17 +107,15 @@ async function downloadImage(url) {
|
|
|
107
107
|
const fileUrl = `https://${defaultSettings.nodeEnv}/quote/resources/assets/${url}`
|
|
108
108
|
const response = await fetch(fileUrl);
|
|
109
109
|
if (!response.ok) {
|
|
110
|
-
|
|
111
|
-
throw new Error(`Error downloading image ${url}: ${response.statusText}`);
|
|
110
|
+
throw new Error(`Error downloading image ${fileUrl}: ${response.statusText}`);
|
|
112
111
|
}
|
|
113
112
|
const buffer = Buffer.from(await response.arrayBuffer());
|
|
114
113
|
fs.mkdirSync(path.dirname(imagePath), { recursive: true });
|
|
115
114
|
fs.writeFileSync(imagePath, buffer);
|
|
116
|
-
console.log(`Downloaded image ${
|
|
115
|
+
console.log(`Downloaded image ${fileUrl}`);
|
|
117
116
|
return imagePath;
|
|
118
117
|
} catch (error) {
|
|
119
|
-
|
|
120
|
-
throw new Error(`Error downloading image ${url}: ${error}`);
|
|
118
|
+
throw new Error(`Error downloading image ${fileUrl}: ${error}`);
|
|
121
119
|
}
|
|
122
120
|
}
|
|
123
121
|
|