INNER CODE UNIT · Python
get_proton
AUNaseef/protonup · protonup/api.py:109
def get_proton(version=None, yes=True, dl_only=False, output=None) -> bool:
"""Download and (optionally) install Proton"""
installdir = install_directory()
data = fetch_data(tag=version)
if not data or 'download' not in data:
if not yes:
print('[ERROR] invalid tag / binary not found')
return False
protondir = installdir + data['version']
checksum_dir = protondir + '/sha512sum'
source_checksum = requests.get(data['checksum']).text if 'checksum' in data else None
local_checksum = open(checksum_dir).read() if os.path.exists(checksum_dir) else None
# Check if it already exist
if os.path.exists(protondir) and not dl_only:
if local_checksum and source_checksum: