Skip to content

Commit e67e61a

Browse files
committed
update Gravitas font URL; raise error if download fails
1 parent 9d02b7d commit e67e61a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.circleci/download_google_fonts.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,19 @@
22

33
dirOut = '.circleci/fonts/truetype/googleFonts/'
44

5-
def download(repo, family, types) :
5+
def download(repo, family, types):
66
for t in types :
77
name = family + t + '.ttf'
88
url = repo + name + '?raw=true'
99
print(url)
1010
req = requests.get(url, allow_redirects=True)
11+
if req.status_code != 200:
12+
raise RuntimeError(f"""
13+
Download failed.
14+
Status code: {req.status_code}
15+
Message: {req.reason}
16+
"""
17+
)
1118
open(dirOut + name, 'wb').write(req.content)
1219

1320
download(
@@ -82,7 +89,7 @@ def download(repo, family, types) :
8289
)
8390

8491
download(
85-
'https://github.com/expo/google-fonts/blob/master/font-packages/gravitas-one/',
92+
'https://github.com/expo/google-fonts/blob/main/font-packages/gravitas-one/400Regular/',
8693
'GravitasOne',
8794
[
8895
'_400Regular'

0 commit comments

Comments
 (0)