mirror of
https://github.com/hubHarmony/servii-backend.git
synced 2024-11-17 21:40:31 +00:00
[+] generic_executor type safety /2
This commit is contained in:
parent
5d9cf5ae5e
commit
7147cc9b88
@ -2,6 +2,17 @@ import os
|
||||
import shutil
|
||||
import re
|
||||
|
||||
supported_versions = ["bukkit", "paper", "spigot"]
|
||||
|
||||
def get_all_versions(folder_path="servers/paper"):
|
||||
return [name for name in os.listdir(folder_path) if os.path.isdir(os.path.join(folder_path, name))]
|
||||
|
||||
def version_exists(version, framework = "paper")->bool:
|
||||
if framework not in supported_versions:
|
||||
return False
|
||||
folder_names = get_all_versions("servers/"+framework)
|
||||
return any(version in name for name in folder_names)
|
||||
|
||||
def create_folder(path):
|
||||
os.makedirs(path, exist_ok=True)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user