Skip to content

Commit a5608df

Browse files
committed
fix default snippet downloader
1 parent 90ab4ca commit a5608df

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

update_example_snippets.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
domain = b'https://gist.github.com'
1212
path = b'/psifertex/6fbc7532f536775194edd26290892ef7' # Feel free to adapt to your own setup
13+
archive = path + b'/archive/'
1314
subfolder = 'default' # Change to save the snippets to a different sub-folder
1415
tab2space = False
1516
width = 4
@@ -32,8 +33,8 @@ def update_snippets():
3233
url = domain + path
3334
log_info("Downloading from: %s" % url)
3435
source = download(url)
35-
zipPath = [s for s in source.split(b'\"') if s.endswith(b'.zip')]
36-
if len(zipPath) != 1:
36+
zipPath = [s for s in source.split(b'\"') if s.endswith(b'.zip') and archive in s]
37+
if len(zipPath) != 2:
3738
log_error("Update failed.")
3839
return
3940
url = domain + zipPath[0]

0 commit comments

Comments
 (0)