mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1127666 (Recipes with slash in name can't be called with ebook-convert)
This commit is contained in:
parent
d181153952
commit
82ecd7bdfa
@ -67,6 +67,8 @@ def check_command_line_options(parser, args, log):
|
||||
('-h' in args or '--help' in args):
|
||||
log.error('Cannot read from', input)
|
||||
raise SystemExit(1)
|
||||
if input.endswith('.recipe') and not os.access(input, os.R_OK):
|
||||
input = args[1]
|
||||
|
||||
output = args[2]
|
||||
if (output.startswith('.') and output[:2] not in {'..', '.'} and '/' not in
|
||||
|
@ -68,10 +68,15 @@ class RecipeInput(InputFormatPlugin):
|
||||
recipe = compile_recipe(self.recipe_source)
|
||||
log('Using custom recipe')
|
||||
else:
|
||||
from calibre.web.feeds.recipes.collection import \
|
||||
get_builtin_recipe_by_title
|
||||
from calibre.web.feeds.recipes.collection import (
|
||||
get_builtin_recipe_by_title, get_builtin_recipe_titles)
|
||||
title = getattr(opts, 'original_recipe_input_arg', recipe_or_file)
|
||||
title = os.path.basename(title).rpartition('.')[0]
|
||||
titles = frozenset(get_builtin_recipe_titles())
|
||||
if title not in titles:
|
||||
title = getattr(opts, 'original_recipe_input_arg', recipe_or_file)
|
||||
title = title.rpartition('.')[0]
|
||||
|
||||
raw = get_builtin_recipe_by_title(title, log=log,
|
||||
download_recipe=not opts.dont_download_recipe)
|
||||
builtin = False
|
||||
|
Loading…
x
Reference in New Issue
Block a user