Fixes Build Script & Formatting

- Build file is updated to prevent running `mkdir` command if the directory exists

- Formatting error is fixed
This commit is contained in:
*Nix Fanboy
2024-10-25 16:30:39 +03:00
parent 25e42270a6
commit 8b24b6fec4
2 changed files with 16 additions and 7 deletions

View File

@@ -1,4 +1,5 @@
from os import system
from os.path import exists
from sys import argv, stderr
from platform import system as os_name
@@ -6,8 +7,12 @@ def build():
system("mkdir -p build")
system("git clone https://github.com/nix-enthusiast/unildd.git build/unildd")
system("cargo build --release --manifest-path=build/unildd/Cargo.toml")
system("mkdir lib")
system("mkdir include")
if not exists("lib"):
system("mkdir lib")
if not exists("include"):
system("mkdir include")
# I know this logic is dodgy
match os_name():
@@ -20,7 +25,6 @@ def build():
system("cp build/unildd/header/unildd.h include")
match argv[1]:
case "--build" | "-b":
build()