From cef587be49a05659f70b073e66d1d361b1d5e301 Mon Sep 17 00:00:00 2001 From: *Nix Fanboy <63163893+nix-enthusiast@users.noreply.github.com> Date: Tue, 19 Nov 2024 14:57:33 +0300 Subject: [PATCH] Rebuild Option - Rebuild option is added --- README.md | 7 ++++--- build.py | 7 ++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 70239eb..13fc44c 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,10 @@ OBJDetect is a program made in Go as an example of how to use [unildd](https://g - Run the `build.py` file: ``` - python3 build.py --build # To build the program - python3 build.py --run # To directly run the program - python3 build.py --clean # To remove the build directory + 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 ``` - Take the file named `objdetect` (or `objdetect.exe` in Windows) from the directory named `build` and put it anywhere you want! diff --git a/build.py b/build.py index f11cb27..c4fc69f 100644 --- a/build.py +++ b/build.py @@ -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)