Skip to content

Commit 71a4d77

Browse files
committed
try overwrite
1 parent 6c85949 commit 71a4d77

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.circleci/download_google_fonts.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
dir_out = ".circleci/fonts/truetype/googleFonts/"
66

77

8-
def download(repo, family, types):
8+
def download(repo, family, types, overwrite=True):
99
for t in types:
1010
name = family + t + ".ttf"
1111
url = repo + name + "?raw=true"
12-
outfile = dir_out + name
12+
out_file = dir_out + name
1313
print("Getting: ", url)
14-
if os.path.exists(outfile):
15-
print(" => Already exists: ", outfile)
14+
if os.path.exists(out_file) and not overwrite:
15+
print(" => Already exists: ", out_file)
1616
continue
1717
req = requests.get(url, allow_redirects=False)
1818
if req.status_code != 200:
@@ -25,7 +25,7 @@ def download(repo, family, types):
2525
Status code: {req.status_code}
2626
Message: {req.reason}
2727
""")
28-
open(outfile, "wb").write(req.content)
28+
open(out_file, "wb").write(req.content)
2929

3030

3131
download(

0 commit comments

Comments
 (0)