koishi-plugin-minecraft-notifier 1.1.0 → 1.1.1

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.
Files changed (2) hide show
  1. package/lib/index.cjs +5 -6
  2. package/package.json +1 -1
package/lib/index.cjs CHANGED
@@ -552,6 +552,7 @@ async function fetchArticleContent(ctx, version, isSnapshot) {
552
552
  }
553
553
 
554
554
  // src/index.ts
555
+ var import_fs = __toESM(require("fs"), 1);
555
556
  var name = "minecraft-notifier";
556
557
  var inject = ["database", "server"];
557
558
  var Config = import_koishi.Schema.object({
@@ -632,18 +633,16 @@ function apply(ctx, cfg) {
632
633
  }
633
634
  }
634
635
  };
636
+ const xamlPath = import_node_path2.default.join(ctx.baseDir, "data", "minecraft-notifier", "xaml");
637
+ if (!import_fs.default.existsSync(xamlPath)) {
638
+ import_fs.default.mkdirSync(xamlPath, { recursive: true });
639
+ }
635
640
  ctx.server.get("/PCL", async (koaCtx) => {
636
641
  koaCtx.set("Content-Type", "application/xml; charset=utf-8");
637
642
  koaCtx.set(
638
643
  "Content-Disposition",
639
644
  'inline; filename="PCL.HomePage.xaml"'
640
645
  );
641
- const xamlPath = import_node_path2.default.join(
642
- ctx.baseDir,
643
- "data",
644
- "minecraft-notifier",
645
- "xaml"
646
- );
647
646
  let fullHomePagePath = import_node_path2.default.join(xamlPath, "PCL.HomePage.xaml");
648
647
  koaCtx.response.body = await import_node_fs2.promises.readFile(fullHomePagePath);
649
648
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-minecraft-notifier",
3
3
  "description": "A Minecraft new version notification plugin, also featuring a PCL homepage.",
4
- "version": "1.1.0",
4
+ "version": "1.1.1",
5
5
  "main": "lib/index.cjs",
6
6
  "typings": "lib/index.d.ts",
7
7
  "type": "module",