mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 13:10:30 +08:00
filter theme file
This commit is contained in:
parent
e92b3d250a
commit
ca42519e85
@ -12,7 +12,9 @@ let insertedCSSKey: string | undefined = undefined
|
|||||||
export async function resolveThemes(): Promise<{ key: string; label: string }[]> {
|
export async function resolveThemes(): Promise<{ key: string; label: string }[]> {
|
||||||
const files = await readdir(themesDir())
|
const files = await readdir(themesDir())
|
||||||
const themes = await Promise.all(
|
const themes = await Promise.all(
|
||||||
files.map(async (file) => {
|
files
|
||||||
|
.filter((file) => file.endsWith('.css'))
|
||||||
|
.map(async (file) => {
|
||||||
const css = (await readFile(path.join(themesDir(), file), 'utf-8')) || ''
|
const css = (await readFile(path.join(themesDir(), file), 'utf-8')) || ''
|
||||||
let name = file
|
let name = file
|
||||||
if (css.startsWith('/*')) {
|
if (css.startsWith('/*')) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user