foundrytools-cli 2.2.1__py3-none-any.whl → 2.2.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
- VERSION = __version__ = "2.2.1"
1
+ VERSION = __version__ = "2.2.2"
2
2
 
3
3
  __all__ = ["VERSION"]
@@ -50,14 +50,20 @@ def _determine_output_directory(
50
50
  return sanitize_filepath(out_dir, platform="auto")
51
51
 
52
52
 
53
- def _remove_empty_directories(directory: Path) -> None:
53
+ def _remove_empty_directories(directory: Path, stop_at: Path | None = None) -> None:
54
54
  """
55
55
  Removes empty directories recursively.
56
56
 
57
57
  Args:
58
58
  directory (Path): The directory to start removing from.
59
+ stop_at (Path): The directory to stop at (never removed). Defaults to None, which
60
+ means no boundary. Callers should pass the input directory so cleanup never
61
+ climbs above it.
59
62
  """
60
- while not any(directory.iterdir()):
63
+ stop = stop_at.resolve() if stop_at is not None else None
64
+ while directory.is_dir() and (stop is None or directory.resolve() != stop):
65
+ if any(directory.iterdir()):
66
+ break
61
67
  directory.rmdir()
62
68
  logger.opt(colors=True).success(f"{directory} <magenta>--></> <red>Deleted</>")
63
69
  directory = directory.parent
@@ -115,4 +121,5 @@ def main(
115
121
  )
116
122
 
117
123
  if delete_empty_directories:
118
- _remove_empty_directories(font.file.parent)
124
+ stop_at = in_path if in_path.is_dir() else in_path.parent
125
+ _remove_empty_directories(font.file.parent, stop_at=stop_at)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: foundrytools-cli
3
- Version: 2.2.1
3
+ Version: 2.2.2
4
4
  Summary: A set of command line tools to inspect, manipulate and convert font files
5
5
  Author: Cesare Gilento
6
6
  Author-email: Cesare Gilento <ftcli@proton.me>
@@ -1,4 +1,4 @@
1
- foundrytools_cli/__init__.py,sha256=sbn6cAzth_0W8DKGXXzEzzbAeIAiO87N0lzpVApo2OY,55
1
+ foundrytools_cli/__init__.py,sha256=kFf6kATo3E1f6TMp1TkglYgUcEhMpNJgM65FbPdfLXM,55
2
2
  foundrytools_cli/__main__.py,sha256=wN2lDr2iQyzfnOP00_P3DyXIxEBbf6K_cuzX5YFH5Fg,1273
3
3
  foundrytools_cli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  foundrytools_cli/commands/cff.py,sha256=6eEZydw0ZyISjYuV0JObmNBI7ijdEvVatKwWc8FM5vw,3386
@@ -25,14 +25,14 @@ foundrytools_cli/commands/print/vf_instances.py,sha256=vpp3sMyCcNh9f6CBbOn5lnWr4
25
25
  foundrytools_cli/commands/ttf.py,sha256=0ZJc36MM8m12_reMVD6GS5ZpSt84g_9RpXrKz_zqqfI,2151
26
26
  foundrytools_cli/commands/utils/__init__.py,sha256=bF8Ue4I4QAaDplSpDSMvtb4AZMWjcYsTNIL5ZBp6-t8,71
27
27
  foundrytools_cli/commands/utils/cli.py,sha256=OKX4FEzcDP9DZHyAk0tN2vuFoQ__BtmvIfP34hbsEYE,3685
28
- foundrytools_cli/commands/utils/font_organizer.py,sha256=9biz8Cxg81qNGtK53zp4xhgncbItE5xRXBL1Y1ZWHqg,4096
28
+ foundrytools_cli/commands/utils/font_organizer.py,sha256=UL2y7Rauax3S3PxMX6CX1lV0Uk-EA8kKjhW2C7s_MpI,4576
29
29
  foundrytools_cli/commands/utils/font_renamer.py,sha256=eEWT_1CCXu0mRXTOx5okUQ1NJrqs2RiG-TsRhbAMoRw,5755
30
30
  foundrytools_cli/commands/utils/sync_timestamps.py,sha256=h9BMafxlmFllXKyrqBwibQIupS_d2Rp0TXEIfjk7UZQ,3989
31
31
  foundrytools_cli/utils/__init__.py,sha256=m-jBbONfS-_WMbpql8GV_1KufNoWOLQuNQtqErH-WmQ,7962
32
32
  foundrytools_cli/utils/logger.py,sha256=ZjVgZ1AmzwwH1GEnBU1HP-pFvZv0BKkVV93P2gYvnLc,525
33
33
  foundrytools_cli/utils/task_runner.py,sha256=CXVItMJTslNuie_rhPpZrQBX5rgkWbAWX805dFIBInA,6965
34
34
  foundrytools_cli/utils/timer.py,sha256=i_E1nM4KuooZwT2_2bkNJCxLrSKBaQCIMaHxTHY-Hzs,1870
35
- foundrytools_cli-2.2.1.dist-info/WHEEL,sha256=9IUYslYuG_asT4WlWvfk_K76nveuLvSTKDoLeL0cV-Q,80
36
- foundrytools_cli-2.2.1.dist-info/entry_points.txt,sha256=sNn6z8yZnx3Koh85LS6BYDqzaXZSP4KEvN3AdFGYRao,57
37
- foundrytools_cli-2.2.1.dist-info/METADATA,sha256=EX2xD7jjsAqGijDhsEeeyoVqTh7aFpJWQoG9Ckza3ZU,3777
38
- foundrytools_cli-2.2.1.dist-info/RECORD,,
35
+ foundrytools_cli-2.2.2.dist-info/WHEEL,sha256=MWx7psoF7KNST9G72pGtiBYuaXRXQXBk9pw5R6FzYko,80
36
+ foundrytools_cli-2.2.2.dist-info/entry_points.txt,sha256=sNn6z8yZnx3Koh85LS6BYDqzaXZSP4KEvN3AdFGYRao,57
37
+ foundrytools_cli-2.2.2.dist-info/METADATA,sha256=6tU5bWSXQHGA5ZfwJSJF06pr0_LYIkif7VKaxCkSLGs,3777
38
+ foundrytools_cli-2.2.2.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: uv 0.13.1
2
+ Generator: uv 0.13.7
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any