parent
2490c3a7e7
commit
33388cf209
1 changed files with 17 additions and 12 deletions
|
|
@ -39,6 +39,7 @@ export const properties = {
|
||||||
"fb2",
|
"fb2",
|
||||||
"html",
|
"html",
|
||||||
"htmlz",
|
"htmlz",
|
||||||
|
"kepub.epub",
|
||||||
"lit",
|
"lit",
|
||||||
"lrf",
|
"lrf",
|
||||||
"mobi",
|
"mobi",
|
||||||
|
|
@ -65,7 +66,10 @@ export async function convert(
|
||||||
options?: unknown,
|
options?: unknown,
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
execFile("ebook-convert", [filePath, targetPath], (error, stdout, stderr) => {
|
execFile(
|
||||||
|
"ebook-convert",
|
||||||
|
[filePath, targetPath],
|
||||||
|
(error, stdout, stderr) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
reject(`error: ${error}`);
|
reject(`error: ${error}`);
|
||||||
}
|
}
|
||||||
|
|
@ -79,6 +83,7 @@ export async function convert(
|
||||||
}
|
}
|
||||||
|
|
||||||
resolve("Done");
|
resolve("Done");
|
||||||
});
|
},
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue