mirror of
https://github.com/C4illin/ConvertX.git
synced 2026-06-28 06:55:48 +00:00
@@ -39,6 +39,7 @@ export const properties = {
|
||||
"fb2",
|
||||
"html",
|
||||
"htmlz",
|
||||
"kepub.epub",
|
||||
"lit",
|
||||
"lrf",
|
||||
"mobi",
|
||||
@@ -65,20 +66,24 @@ export async function convert(
|
||||
options?: unknown,
|
||||
): Promise<string> {
|
||||
return new Promise((resolve, reject) => {
|
||||
execFile("ebook-convert", [filePath, targetPath], (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
reject(`error: ${error}`);
|
||||
}
|
||||
execFile(
|
||||
"ebook-convert",
|
||||
[filePath, targetPath],
|
||||
(error, stdout, stderr) => {
|
||||
if (error) {
|
||||
reject(`error: ${error}`);
|
||||
}
|
||||
|
||||
if (stdout) {
|
||||
console.log(`stdout: ${stdout}`);
|
||||
}
|
||||
if (stdout) {
|
||||
console.log(`stdout: ${stdout}`);
|
||||
}
|
||||
|
||||
if (stderr) {
|
||||
console.error(`stderr: ${stderr}`);
|
||||
}
|
||||
if (stderr) {
|
||||
console.error(`stderr: ${stderr}`);
|
||||
}
|
||||
|
||||
resolve("Done");
|
||||
});
|
||||
resolve("Done");
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user