Skip to content

Commit

Permalink
Continue if license detection fails
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncozens committed Nov 14, 2024
1 parent a64af18 commit cce4dd4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Lib/gftools/scripts/add_font.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ def _MakeMetadata(args, is_new):

first_file = file_family_style_weights[0].file
old_metadata_file = os.path.join(args.directory, "METADATA.pb")
font_license = fonts.LicenseFromPath(args.directory)

metadata = fonts_pb2.FamilyProto()
metadata.name = file_family_style_weights[0].family
Expand Down Expand Up @@ -214,7 +213,12 @@ def _MakeMetadata(args, is_new):
):
metadata.primary_script = script

metadata.license = font_license
try:
font_license = fonts.LicenseFromPath(args.directory)
metadata.license = font_license
except ValueError:
print("WARNING: Could not determine license for %s" % args.directory)
print("Continuing without setting license.")
subsets = sorted(subsets)
for subset in subsets:
metadata.subsets.append(subset)
Expand Down

0 comments on commit cce4dd4

Please sign in to comment.