mirror of
https://github.com/jeertmans/manim-slides.git
synced 2025-08-06 14:19:52 +08:00
@ -27,6 +27,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
[#447](https://github.com/jeertmans/manim-slides/pull/447)
|
[#447](https://github.com/jeertmans/manim-slides/pull/447)
|
||||||
- Improved issue templates.
|
- Improved issue templates.
|
||||||
[#456](https://github.com/jeertmans/manim-slides/pull/456)
|
[#456](https://github.com/jeertmans/manim-slides/pull/456)
|
||||||
|
- Enhancer the error message when the slides folder does not exist.
|
||||||
|
[#462](https://github.com/jeertmans/manim-slides/pull/462)
|
||||||
|
|
||||||
(unreleased-fixed)=
|
(unreleased-fixed)=
|
||||||
### Fixed
|
### Fixed
|
||||||
|
@ -70,11 +70,22 @@ def verbosity_option(function: F) -> F:
|
|||||||
|
|
||||||
def folder_path_option(function: F) -> F:
|
def folder_path_option(function: F) -> F:
|
||||||
"""Wrap a function to add folder path option."""
|
"""Wrap a function to add folder path option."""
|
||||||
|
|
||||||
|
def callback(ctx: Context, param: Parameter, value: Path) -> Path:
|
||||||
|
if not value.exists():
|
||||||
|
raise click.UsageError(
|
||||||
|
f"Invalid value for '--folder': Directory '{value}' does not exist. "
|
||||||
|
"Did you render the animations first?",
|
||||||
|
ctx=ctx,
|
||||||
|
)
|
||||||
|
return value
|
||||||
|
|
||||||
wrapper: Wrapper = click.option(
|
wrapper: Wrapper = click.option(
|
||||||
"--folder",
|
"--folder",
|
||||||
metavar="DIRECTORY",
|
metavar="DIRECTORY",
|
||||||
default=FOLDER_PATH,
|
default=FOLDER_PATH,
|
||||||
type=click.Path(exists=True, file_okay=False, path_type=Path),
|
type=click.Path(file_okay=False, path_type=Path),
|
||||||
|
callback=callback,
|
||||||
help="Set slides folder.",
|
help="Set slides folder.",
|
||||||
show_default=True,
|
show_default=True,
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user