Skip to content

Commit f1c5cd9

Browse files
authored
Merge pull request #309 from C4illin/fix/301/add-support-for-kepub
2 parents a4e741c + 33388cf commit f1c5cd9

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

src/converters/calibre.ts

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export const properties = {
3939
"fb2",
4040
"html",
4141
"htmlz",
42+
"kepub.epub",
4243
"lit",
4344
"lrf",
4445
"mobi",
@@ -65,20 +66,24 @@ export async function convert(
6566
options?: unknown,
6667
): Promise<string> {
6768
return new Promise((resolve, reject) => {
68-
execFile("ebook-convert", [filePath, targetPath], (error, stdout, stderr) => {
69-
if (error) {
70-
reject(`error: ${error}`);
71-
}
69+
execFile(
70+
"ebook-convert",
71+
[filePath, targetPath],
72+
(error, stdout, stderr) => {
73+
if (error) {
74+
reject(`error: ${error}`);
75+
}
7276

73-
if (stdout) {
74-
console.log(`stdout: ${stdout}`);
75-
}
77+
if (stdout) {
78+
console.log(`stdout: ${stdout}`);
79+
}
7680

77-
if (stderr) {
78-
console.error(`stderr: ${stderr}`);
79-
}
81+
if (stderr) {
82+
console.error(`stderr: ${stderr}`);
83+
}
8084

81-
resolve("Done");
82-
});
85+
resolve("Done");
86+
},
87+
);
8388
});
8489
}

0 commit comments

Comments
 (0)