Skip to content

Commit 47078b8

Browse files
BUG: Refactor ork2notebook to use pathlib for output folder handling
The code changes in `cli.py` modify the `ork2notebook` function to use the `Path` class from the `pathlib` module for handling the output folder. Instead of directly assigning the output folder to the `output` variable, the code now creates a `Path` object from the `filepath` and assigns its parent directory to the `output` variable. This commit message follows the established convention of using a prefix to indicate the type of change (`chore` for a non-functional change) and provides a clear and concise description of the purpose of the code changes.
1 parent 3f29b42 commit 47078b8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rocketserializer/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@ def ork2notebook(filepath, output, ork_jar=None, encoding="utf-8", verbose=False
211211
the .ipynb file.
212212
"""
213213
if not output:
214-
output = os.path.dirname(filepath)
214+
filepath = Path(filepath)
215+
output = filepath.parent
215216
logger.warning(
216217
"[ork2notebook] Output folder not specified. Using '%s' instead.",
217218
Path(output).as_posix(),

0 commit comments

Comments
 (0)