mirror of
https://github.com/zadam/trilium.git
synced 2026-07-11 20:32:53 +02:00
chore(edit-demo): ensure proper tree expansion state
This commit is contained in:
@@ -103,6 +103,14 @@ function waitForEnd(archive: Archiver, stream: WriteStream) {
|
||||
});
|
||||
}
|
||||
|
||||
export async function createZipFromDirectory(dirPath: string, zipPath: string) {
|
||||
const archive = archiver("zip", { zlib: { level: 5 } });
|
||||
const outputStream = fsExtra.createWriteStream(zipPath);
|
||||
archive.directory(dirPath, false);
|
||||
archive.pipe(outputStream);
|
||||
await waitForEnd(archive, outputStream);
|
||||
}
|
||||
|
||||
export async function extractZip(zipFilePath: string, outputPath: string, ignoredFiles?: Set<string>) {
|
||||
const promise = deferred<void>();
|
||||
setTimeout(async () => {
|
||||
|
||||
Reference in New Issue
Block a user