Skip to content

Commit

Permalink
player: 修正读取插件报错的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve-xmh committed Oct 11, 2024
1 parent 0cc1472 commit 025140b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/player/src/states/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { appDataDir, join } from "@tauri-apps/api/path";
import { readDir, readTextFile } from "@tauri-apps/plugin-fs";
import { mkdir, readDir, readTextFile } from "@tauri-apps/plugin-fs";
import { atom } from "jotai";
import type { PlayerPluginContext } from "../components/PluginContext";
import i18n from "../i18n";
Expand Down Expand Up @@ -42,6 +42,7 @@ export const pluginMetaAtom = atom(
async (get) => {
get(reloadPluginMetaAtom);
const pluginDir = await get(pluginDirAtom);
await mkdir(pluginDir, { recursive: true });
const plugins = await readDir(pluginDir);
const META_REGEX = /^\/\/\s*@(\S+)\s*(.+)$/;
const pluginMetas = await Promise.all(
Expand Down

0 comments on commit 025140b

Please sign in to comment.