release-download-latest 759 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/env python3
  2. import common
  3. from shell_helpers import LF
  4. class Main(common.LkmcCliFunction):
  5. def __init__(self):
  6. super().__init__(
  7. description='''\
  8. Usage: https://cirosantilli.com/linux-kernel-module-cheat#prebuilt
  9. Implementation:
  10. https://stackoverflow.com/questions/24987542/is-there-a-link-to-github-for-downloading-a-file-in-the-latest-release-of-a-repo/50540591#50540591
  11. ''',
  12. )
  13. def timed_main(self):
  14. self.log_info('Downloading the release, this may take several seconds / a few minutes.')
  15. _json = self.github_make_request(path='/releases')
  16. asset = _json[0]['assets'][0]
  17. self.sh.wget(asset['browser_download_url'], asset['name'])
  18. if __name__ == '__main__':
  19. Main().cli()