Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions scripts/SetupPremake.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,22 @@ class PremakeConfiguration:
premakeLicenseUrl = "https://raw.githubusercontent.com/premake/premake-core/master/LICENSE.txt"
premakeDirectory = "./vendor/premake/bin"

@classmethod
def Validate(cls):
def Validate(self):
if (not cls.CheckIfPremakeInstalled()):
print("Premake is not installed.")
return False

print(f"Correct Premake located at {os.path.abspath(cls.premakeDirectory)}")
return True

@classmethod
def CheckIfPremakeInstalled(cls):
def CheckIfPremakeInstalled(self):
premakeExe = Path(f"{cls.premakeDirectory}/premake5.exe");
if (not premakeExe.exists()):
return cls.InstallPremake()
return self.InstallPremake()

return True

@classmethod
def InstallPremake(cls):
def InstallPremake(self):
permissionGranted = False
while not permissionGranted:
reply = str(input("Premake not found. Would you like to download Premake {0:s}? [Y/N]: ".format(cls.premakeVersion))).lower().strip()[:1]
Expand Down