File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 101101
102102# __get_download_url returns the download URL for the given file, for the latest or the given GitHub release.
103103def __get_download_url (file : str ) -> str :
104- if 'current_version' not in html_context or not __is_sem_version (html_context ['current_version' ]):
105- return f"https://github.com/liqotech/liqo/releases/latest/download/{ file } "
106- else :
107- return f"https://github.com/liqotech/liqo/releases/download/master/{ file } "
108-
104+ version = generate_version ()
105+ if version == 'master' :
106+ x = requests .get ('https://api.github.com/repos/liqotech/liqo/releases/latest' )
107+ version = x .json ()['tag_name' ]
108+ return f"https://github.com/liqotech/liqo/releases/download/{ version } /{ file } "
109+
109110# generate_version generates the version string for the current page.
111+ # latest: return master
112+ # stable: return the latest release (get the last release tag from GitHub API)
113+ # tag: return the tag specified in the html_context[github_version]
110114def generate_version () -> str :
111115 version = html_context ['github_version' ] if 'github_version' in html_context else 'master'
112116 if 'current_version' in html_context and html_context ['current_version' ] == 'stable' :
You can’t perform that action at this time.
0 commit comments