mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-23 08:23:12 +09:00
Fix broken manifest path resolution (#1047)
This commit is contained in:
1 parent
793f23a390
commit
d1b1f58f00
1 file changed
+4
-3
@@ -842,7 +842,7 @@ export default class Controller {
|
|||||||
try {
|
try {
|
||||||
manifest = JSON.parse(await fs.readFile(filePath, { encoding: "utf8" }));
|
manifest = JSON.parse(await fs.readFile(filePath, { encoding: "utf8" }));
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
if (!throwOnMissing && err.code !== "ENOENT") {
|
if (throwOnMissing && err.code !== "ENOENT") {
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1132,8 +1132,9 @@ export default class Controller {
|
|||||||
const context = { metrics, logger, controller: this };
|
const context = { metrics, logger, controller: this };
|
||||||
for (let pluginInfo of this.pluginInfos) {
|
for (let pluginInfo of this.pluginInfos) {
|
||||||
try {
|
try {
|
||||||
let manifestPath = path.posix.join(pluginInfo.requirePath, "dist", "web", "manifest.json");
|
const manifestPath = path.posix.join(pluginInfo.requirePath, "dist", "web", "manifest.json");
|
||||||
pluginInfo.manifest = await Controller.loadJsonObject(import.meta.resolve(manifestPath), true);
|
const resolvedManifestPath = fileURLToPath(import.meta.resolve(manifestPath));
|
||||||
|
pluginInfo.manifest = await Controller.loadJsonObject(resolvedManifestPath, true);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (lib.pluginNeedsWebBuild(pluginInfo)) {
|
if (lib.pluginNeedsWebBuild(pluginInfo)) {
|
||||||
logger.warn(`Unable to load dist/web/manifest.json for plugin ${pluginInfo.name}`);
|
logger.warn(`Unable to load dist/web/manifest.json for plugin ${pluginInfo.name}`);
|
||||||
|
|||||||
Reference in new issue
Block a user