mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-29 00:11:32 +08:00
fix(edit-docs): relative path
This commit is contained in:
parent
a1918ad491
commit
15936ff8b8
@ -58,8 +58,7 @@ async function createImportZip() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
async function iterate(currentPath: string) {
|
async function iterate(currentPath: string) {
|
||||||
console.log("Found ", currentPath);
|
for (const entry of await fs.readdir(path.join(destRootPath, currentPath), { withFileTypes: true })) {
|
||||||
for (const entry of await fs.readdir(currentPath, { withFileTypes: true })) {
|
|
||||||
const entryPath = path.join(currentPath, entry.name);
|
const entryPath = path.join(currentPath, entry.name);
|
||||||
|
|
||||||
if (entry.isDirectory()) {
|
if (entry.isDirectory()) {
|
||||||
@ -67,14 +66,14 @@ async function createImportZip() {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const source = fsExtra.createReadStream(entryPath);
|
const source = fsExtra.createReadStream(path.join(destRootPath, entryPath));
|
||||||
archive.append(source, {
|
archive.append(source, {
|
||||||
name: entryPath
|
name: path.join(currentPath, entry.name)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await iterate(destRootPath);
|
await iterate("/");
|
||||||
|
|
||||||
const outputStream = fsExtra.createWriteStream("input.zip");
|
const outputStream = fsExtra.createWriteStream("input.zip");
|
||||||
archive.pipe(outputStream);
|
archive.pipe(outputStream);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user