refactor: cleanup

This commit is contained in:
Dobin Rutishauser
2025-06-09 15:40:17 +02:00
parent 99ad23d69d
commit f55596f4a8
3 changed files with 21 additions and 28 deletions
+16 -2
View File
@@ -15,16 +15,30 @@ def check_deps():
cl = config.get("path_cl")
if shutil.which(cl) == None:
logger.error("Missing dependency: " + cl)
logger.error("Start in x64 Native Tools Command Prompt for VS 2022")
logger.error("See README for fix")
exit(1)
ml = config.get("path_ml64")
if shutil.which(ml) == None:
logger.error("Missing dependency: " + ml)
logger.error("Start in x64 Native Tools Command Prompt for VS 2022")
logger.error("See README for fix")
exit(1)
def command_exists(cmd):
try:
# Use the "where" command to check if the command is in the PATH
result = subprocess.run(
["where", cmd],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
shell=True
)
return result.returncode == 0
except Exception:
return False
def delete_all_files_in_directory(directory_path):
files = glob.glob(os.path.join(directory_path, '*'))
for file_path in files: