diff --git a/README.md b/README.md index faaf1be..81b3dbd 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,7 @@ cd zmake # Create and activate venv python3.10 -m venv venv -source venv/bin/active +source venv/bin/activate # Install deps and build pip install -r requirements.txt diff --git a/zmake/project_build.py b/zmake/project_build.py index c6abfd2..bcf1496 100644 --- a/zmake/project_build.py +++ b/zmake/project_build.py @@ -22,6 +22,14 @@ ] +@build_handler("Pre-build command") +def post_build(context: ZMakeContext): + if context.config.get("pre_build_script", "") == "": + return + + subprocess.Popen([os.path.expanduser(context.config["pre_build_script"]), str(context.path)]).wait() + + @build_handler("Prepare") def prepare(context: ZMakeContext): path_build = context.path / "build" @@ -385,4 +393,4 @@ def post_build(context: ZMakeContext): if context.config["post_build_script"] == "": return - subprocess.Popen([context.config["post_build_script"], str(context.path)]).wait() + subprocess.Popen([os.path.expanduser(context.config["post_build_script"]), str(context.path)]).wait() diff --git a/zmake/zmake.json b/zmake/zmake.json index ef4aa92..61bd15f 100644 --- a/zmake/zmake.json +++ b/zmake/zmake.json @@ -20,6 +20,7 @@ "with_adb": false, "adb_path": "/storage/emulated/0/Android/data/com.xiaomi.hm.health/files/watch_skin_local", + "pre_build_script": "", "post_build_script": "", "common_files": [],