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:
10
build.py
10
build.py
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user