mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-02 19:42:51 +08:00
fix(skins): show active screen sharing across bundled themes
This commit is contained in:
1 parent
d9749ac12f
commit
df2ff79e15
20 files changed
+180
-20
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import { readdir, readFile, writeFile } from "node:fs/promises";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { zipSync } from "fflate";
|
||||
|
||||
const sourceDirectory = new URL("../../docs/examples/illusia-voice/", import.meta.url);
|
||||
|
||||
async function collectFiles(directory, prefix = "") {
|
||||
const entries = await readdir(new URL(prefix, directory), { withFileTypes: true });
|
||||
const files = [];
|
||||
for (const entry of entries) {
|
||||
const relativePath = prefix ? `${prefix}/${entry.name}` : entry.name;
|
||||
if (entry.isDirectory()) files.push(...await collectFiles(directory, relativePath));
|
||||
else if (entry.isFile()) files.push(relativePath);
|
||||
}
|
||||
return files;
|
||||
}
|
||||
|
||||
const files = Object.fromEntries(await Promise.all((await collectFiles(sourceDirectory)).map(async (name) => [
|
||||
name,
|
||||
await readFile(new URL(name, sourceDirectory)),
|
||||
])));
|
||||
const archive = zipSync(files, { level: 9 });
|
||||
|
||||
await Promise.all([
|
||||
writeFile(fileURLToPath(new URL("../../docs/examples/illusia-voice.wskin", import.meta.url)), archive),
|
||||
writeFile(fileURLToPath(new URL("../public/skins/illusia-voice.wskin", import.meta.url)), archive),
|
||||
]);
|
||||
Reference in new issue
Block a user