Skip to content

Commit

Permalink
Allow chws_tool to take a file path output (#191)
Browse files Browse the repository at this point in the history
* Allow chws_tool to take a file path output

* fixup! Allow chws_tool to take a file path output
  • Loading branch information
simoncozens authored Mar 17, 2024
1 parent 86a3231 commit 8b3ef95
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/chws_tool/add_chws.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ async def main_async() -> None:
help="comment level for the glyph list",
)
parser.add_argument(
"-o", "--output", default="build", type=pathlib.Path, help="output directory"
"-o",
"--output",
default="build",
type=pathlib.Path,
help="output path or directory",
)
parser.add_argument(
"-p",
Expand All @@ -120,7 +124,7 @@ async def main_async() -> None:
chws.init_logging(args.verbose, main=logger)

# Expand directories.
inputs = chws.Builder.expand_paths(args.inputs)
inputs = list(chws.Builder.expand_paths(args.inputs))

if args.print_name:
_print_font_names(inputs)
Expand All @@ -132,7 +136,9 @@ async def main_async() -> None:
else:
args.glyph_out = pathlib.Path(args.glyph_out)
args.glyph_out.mkdir(exist_ok=True, parents=True)
args.output.mkdir(exist_ok=True, parents=True)

if len(inputs) > 1 or not chws.Font.is_font_extension(args.output.suffix):
args.output.mkdir(exist_ok=True, parents=True)

for input in inputs:
await add_chws_async(
Expand Down

0 comments on commit 8b3ef95

Please sign in to comment.