update plugin themes when plugin was updated (#20052)

This commit is contained in:
Sebastian
2026-03-30 13:51:07 +02:00
committed by GitHub
parent 3c32013eb1
commit 8e4bab5181
6 changed files with 237 additions and 38 deletions

View File

@@ -1,4 +1,4 @@
import { chmod, mkdir, readFile, writeFile } from "fs/promises"
import { chmod, mkdir, readFile, stat as statFile, writeFile } from "fs/promises"
import { createWriteStream, existsSync, statSync } from "fs"
import { lookup } from "mime-types"
import { realpathSync } from "fs"
@@ -25,6 +25,13 @@ export namespace Filesystem {
return statSync(p, { throwIfNoEntry: false }) ?? undefined
}
export async function statAsync(p: string): Promise<ReturnType<typeof statSync> | undefined> {
return statFile(p).catch((e) => {
if (isEnoent(e)) return undefined
throw e
})
}
export async function size(p: string): Promise<number> {
const s = stat(p)?.size ?? 0
return typeof s === "bigint" ? Number(s) : s