INNER CODE UNIT · Python
CheckIfPremakeIsInstalled
Ershany/Arcane-Engine · Setup/PremakeSetup.py:23
def CheckIfPremakeIsInstalled(config):
premakeExe = Path(f"{config.premakeDirectory}/premake5.exe")
if not premakeExe.exists():
return config.InstallPremake()
return True
@classmethod
def InstallPremake(config):
permissionGranted = False
while not permissionGranted:
reply = str(input("Would you like to download Premake {0:s}? [Y/N]: ".format(config.premakeVersion))).lower().strip()[:1]
if reply == 'n':
return False
permissionGranted = (reply == 'y')
premakePath = f"{config.premakeDirectory}/premake-{config.premakeVersion}-windows.zip"
print("Downloading {0:s} to {1:s}".format(config.premakeZipDownloadUrl, premakePath))