Rebuild Option

- Rebuild option is added
This commit is contained in:
*Nix Fanboy
2024-11-19 14:57:33 +03:00
parent 8b24b6fec4
commit cef587be49
2 changed files with 10 additions and 4 deletions

View File

@@ -20,6 +20,7 @@ OBJDetect is a program made in Go as an example of how to use [unildd](https://g
```
python3 build.py --build # To build the program
python3 build.py --rebuild # To rebuild the program
python3 build.py --run # To directly run the program
python3 build.py --clean # To remove the build directory
```

View File

@@ -3,6 +3,7 @@ from os.path import exists
from sys import argv, stderr
from platform import system as os_name
def build():
system("mkdir -p build")
system("git clone https://github.com/nix-enthusiast/unildd.git build/unildd")
@@ -14,7 +15,7 @@ def build():
if not exists("include"):
system("mkdir include")
# I know this logic is dodgy
# I know this logic is dodgy
match os_name():
case "Windows":
system("cp build\\unildd\\target\\release\\libunildd.dll lib")
@@ -25,6 +26,7 @@ def build():
system("cp build/unildd/header/unildd.h include")
match argv[1]:
case "--build" | "-b":
build()
@@ -37,5 +39,8 @@ match argv[1]:
case "--clean" | "-c":
system("rm -rf build")
case "--rebuild" | "-r":
system("go build -o build/objdetect")
case f:
print("Invalid flag '" + f + "'", file=stderr)