create output dir

This commit is contained in:
2026-07-29 08:46:57 +03:00
parent bb6a3931d1
commit df48cd67ea
3 changed files with 41 additions and 3 deletions
+37 -2
View File
@@ -1,3 +1,38 @@
import sll
sll.LOGGING_TAG = "hiwo"
sll.log("test",1)
from pathlib import Path
import os
import shutil
def get_parent_dir():
script_dir = Path(__file__).resolve().parent
return script_dir.parent
def create_dir_os(path):
os.makedirs(path, exist_ok=True)
return os.path.abspath(path)
def delete_dir(path):
target = Path(path)
if target.exists() and target.is_dir():
shutil.rmtree(target)
sll.log(f"Removed tree : {target}")
return True
sll.warn(f"Directory non existend or invalid : {target}")
return False
sll.warn("Build Troposphere script... i hope everything goes well :/")
SOURCE_DIR = get_parent_dir()
sll.log(f"Using source directory -> {SOURCE_DIR}")
delete_dir(str(SOURCE_DIR)+"/output")
OUTPUT_DIR = create_dir_os(f"{SOURCE_DIR}/output")
sll.log(f"Creating output dump -> {OUTPUT_DIR}")