fixed out-dir problem
This commit is contained in:
parent
bf83e1cf0b
commit
9479741b75
2 changed files with 9 additions and 4 deletions
|
@ -107,6 +107,10 @@ on conflict(reader_url)
|
|||
book.title
|
||||
}`.replace(/[/]/g, "%2F");
|
||||
|
||||
await fs.mkdir(opts.outDir, {
|
||||
recursive: true,
|
||||
});
|
||||
|
||||
const files = await fs.readdir(path);
|
||||
|
||||
if (files.every((f) => f.match(/[.](zip|cbz)$/))) {
|
||||
|
@ -117,14 +121,15 @@ on conflict(reader_url)
|
|||
}
|
||||
|
||||
for (const [n, f] of Object.entries(files)) {
|
||||
await fs.rename(
|
||||
await fs.copyFile(
|
||||
`${path}/${f}`,
|
||||
`${opts.outDir}/${title}${
|
||||
files.length > 1 ? ` - ${pad(n)}` : ""
|
||||
}.${f.split(".").at(-1)}`,
|
||||
);
|
||||
}
|
||||
await fs.rmdir(path);
|
||||
|
||||
await fs.rm(path, { recursive: true });
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@fogtype/gadl",
|
||||
"version": "1.4.1",
|
||||
"version": "1.4.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@fogtype/gadl",
|
||||
"version": "1.4.1",
|
||||
"version": "1.4.2",
|
||||
"license": "AGPL-3.0",
|
||||
"dependencies": {
|
||||
"fflate": "^0.8.1",
|
||||
|
|
Loading…
Add table
Reference in a new issue