mirror of
https://github.com/C4illin/ConvertX.git
synced 2026-10-28 07:44:21 +01:00
Merge commit from fork
This commit is contained in:
@@ -27,7 +27,6 @@ export const properties = {
|
||||
"pml",
|
||||
"rb",
|
||||
"rtf",
|
||||
"recipe",
|
||||
"snb",
|
||||
"tcr",
|
||||
"txt",
|
||||
@@ -67,6 +66,18 @@ export async function convert(
|
||||
options?: unknown,
|
||||
execFile: ExecFileFn = execFileOriginal, // to make it mockable
|
||||
): Promise<string> {
|
||||
const normalizedFileType = fileType.toLowerCase();
|
||||
const fileExt = (filePath.split(".").pop() ?? "").toLowerCase();
|
||||
|
||||
if (
|
||||
normalizedFileType === "recipe" ||
|
||||
normalizedFileType === "downloaded_recipe" ||
|
||||
fileExt === "recipe" ||
|
||||
fileExt === "downloaded_recipe"
|
||||
) {
|
||||
throw new Error("Recipe files are not supported");
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
execFile("ebook-convert", [filePath, targetPath], (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
|
||||
Reference in New Issue
Block a user