@saltcorn/plugins-loader 1.1.0-beta.12 → 1.1.0-beta.13
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/download_utils.js +4 -2
- package/package.json +2 -2
- package/plugin_installer.js +10 -4
package/download_utils.js
CHANGED
|
@@ -69,13 +69,15 @@ const loadTarball = (rootFolder, url, name) => {
|
|
|
69
69
|
} else
|
|
70
70
|
reject(
|
|
71
71
|
new Error(
|
|
72
|
-
`Error downloading tarball: http code ${redirect.statusCode}`
|
|
72
|
+
`Error downloading tarball from ${url}: http code ${redirect.statusCode}`
|
|
73
73
|
)
|
|
74
74
|
);
|
|
75
75
|
});
|
|
76
76
|
} else if (res.statusCode !== 200)
|
|
77
77
|
reject(
|
|
78
|
-
new Error(
|
|
78
|
+
new Error(
|
|
79
|
+
`Error downloading tarball from ${url}: http code ${res.statusCode}`
|
|
80
|
+
)
|
|
79
81
|
);
|
|
80
82
|
else {
|
|
81
83
|
const filePath = await writeTarball(res);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saltcorn/plugins-loader",
|
|
3
|
-
"version": "1.1.0-beta.
|
|
3
|
+
"version": "1.1.0-beta.13",
|
|
4
4
|
"description": "Saltcorn plugin loader",
|
|
5
5
|
"homepage": "https://saltcorn.com",
|
|
6
6
|
"scripts": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"env-paths": "^2.2.0",
|
|
13
13
|
"npm-registry-fetch": "17.1.0",
|
|
14
|
-
"@saltcorn/data": "1.1.0-beta.
|
|
14
|
+
"@saltcorn/data": "1.1.0-beta.13"
|
|
15
15
|
},
|
|
16
16
|
"author": "Christian Hugo",
|
|
17
17
|
"license": "MIT",
|
package/plugin_installer.js
CHANGED
|
@@ -111,10 +111,10 @@ class PluginInstaller {
|
|
|
111
111
|
await this.movePlugin(wasInstalled);
|
|
112
112
|
if (await tarballExists(this.rootFolder, this.plugin))
|
|
113
113
|
await removeTarball(this.rootFolder, this.plugin);
|
|
114
|
+
pckJSON = await readPackageJson(this.pckJsonPath);
|
|
115
|
+
const msg = this.checkEngineWarning(pckJSON);
|
|
116
|
+
if (msg && !msgs.includes(msg)) msgs.push(msg);
|
|
114
117
|
}
|
|
115
|
-
pckJSON = await readPackageJson(this.pckJsonPath);
|
|
116
|
-
const msg = this.checkEngineWarning(pckJSON);
|
|
117
|
-
if (msg && !msgs.includes(msg)) msgs.push(msg);
|
|
118
118
|
};
|
|
119
119
|
await installer();
|
|
120
120
|
let module = null;
|
|
@@ -293,7 +293,13 @@ class PluginInstaller {
|
|
|
293
293
|
});
|
|
294
294
|
}
|
|
295
295
|
child.on("exit", (exitCode, signal) => {
|
|
296
|
-
|
|
296
|
+
if (exitCode !== 0) {
|
|
297
|
+
reject(
|
|
298
|
+
new Error(
|
|
299
|
+
`NPM install failed for ${pckJSON.name} with exit code ${exitCode}`
|
|
300
|
+
)
|
|
301
|
+
);
|
|
302
|
+
} else resolve();
|
|
297
303
|
});
|
|
298
304
|
child.on("error", (msg) => {
|
|
299
305
|
reject(msg);
|