Last active
June 4, 2022 09:23
-
-
Save overestimate/33848847974679ff81fa4999af2c1c9b to your computer and use it in GitHub Desktop.
minimal mcsnipergo installer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
RELEASE_SUFFIX = '_Linux_64-bit' | |
import os | |
stream = os.popen('curl -sL https://api.github.com/repos/kqzz/mcsnipergo/releases') | |
res = stream.read()[:-1] | |
import json | |
obj = json.loads(res) | |
url = "" | |
for asset in obj[0]['assets']: | |
if RELEASE_SUFFIX in asset['name']: | |
url = asset['url'] | |
if url == "": | |
print(f"binary not found") | |
os.exit(1) | |
os.system(f'curl --create-dirs -sLo ~/.local/bin/mcsnipergo {url}') | |
os.system('chmod +x ~/.local/bin/mcsnipergo') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment