|
2 | 2 |
|
3 | 3 | dirOut = '.circleci/fonts/truetype/googleFonts/'
|
4 | 4 |
|
5 | | -def download(repo, family, types): |
| 5 | +def download(repo, family, types): |
6 | 6 | for t in types :
|
7 | 7 | name = family + t + '.ttf'
|
8 | 8 | url = repo + name + '?raw=true'
|
9 | 9 | print(url)
|
10 | 10 | 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 | + ) |
11 | 18 | open(dirOut + name, 'wb').write(req.content)
|
12 | 19 |
|
13 | 20 | download(
|
@@ -82,7 +89,7 @@ def download(repo, family, types) :
|
82 | 89 | )
|
83 | 90 |
|
84 | 91 | 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/', |
86 | 93 | 'GravitasOne',
|
87 | 94 | [
|
88 | 95 | '_400Regular'
|
|
0 commit comments