mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-26 19:51:35 +01:00
release-download-latest: bring back to life
This commit is contained in:
@@ -1,17 +1,26 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
'''
|
|
||||||
Usage: https://github.com/cirosantilli/linux-kernel-module-cheat#prebuilt
|
|
||||||
|
|
||||||
Implementation:
|
|
||||||
https://stackoverflow.com/questions/24987542/is-there-a-link-to-github-for-downloading-a-file-in-the-latest-release-of-a-repo/50540591#50540591
|
|
||||||
'''
|
|
||||||
|
|
||||||
import urllib.request
|
import urllib.request
|
||||||
|
|
||||||
import common
|
import common
|
||||||
from shell_helpers import LF
|
from shell_helpers import LF
|
||||||
|
|
||||||
_json = self.github_make_request(path='/releases')
|
class Main(common.LkmcCliFunction):
|
||||||
asset = _json[0]['assets'][0]
|
def __init__(self):
|
||||||
urllib.request.urlretrieve(asset['browser_download_url'], asset['name'])
|
super().__init__(
|
||||||
|
description='''\
|
||||||
|
Usage: https://github.com/cirosantilli/linux-kernel-module-cheat#prebuilt
|
||||||
|
|
||||||
|
Implementation:
|
||||||
|
https://stackoverflow.com/questions/24987542/is-there-a-link-to-github-for-downloading-a-file-in-the-latest-release-of-a-repo/50540591#50540591
|
||||||
|
''',
|
||||||
|
)
|
||||||
|
|
||||||
|
def timed_main(self):
|
||||||
|
self.log_info('Downloading the release, this may take several seconds / a few minutes.')
|
||||||
|
_json = self.github_make_request(path='/releases')
|
||||||
|
asset = _json[0]['assets'][0]
|
||||||
|
urllib.request.urlretrieve(asset['browser_download_url'], asset['name'])
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
Main().cli()
|
||||||
|
|||||||
Reference in New Issue
Block a user