diff options
| author | Stefan Boberg <[email protected]> | 2026-03-19 20:29:35 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2026-03-19 20:29:35 +0100 |
| commit | 43fb80586043da50f81e2e935afb2fbc6f55ec24 (patch) | |
| tree | 2fbdeee593de2437b6a5f8cc464d4f550eb30f97 /xmake.lua | |
| parent | add --hub-hydration-target-spec to zen hub (#867) (diff) | |
| download | zen-43fb80586043da50f81e2e935afb2fbc6f55ec24.tar.xz zen-43fb80586043da50f81e2e935afb2fbc6f55ec24.zip | |
Zen disk benchmark utility (#868)
This PR adds a `zen bench disk` subcommand to help with gathering user performance metrics
It also contains a fix for `xmake precommit`, the task now probes to find the most appropriate way to launch pre-commit
Diffstat (limited to 'xmake.lua')
| -rw-r--r-- | xmake.lua | 27 |
1 files changed, 26 insertions, 1 deletions
@@ -571,7 +571,32 @@ task("precommit") description = "Run required pre-commit steps (clang-format, etc)", } on_run(function () - print(os.exec("python -m pre_commit run --all-files")) + -- pre-commit can be installed as a standalone executable (e.g. via pipx, + -- Homebrew, or system packages) or as a Python module. We prefer the + -- standalone binary because it works regardless of which Python name the + -- system exposes. If it isn't in PATH we fall back to invoking it as a + -- module, trying "python" first since some systems only have that, and + -- "python3" otherwise. + local cmd + try { + function() + os.exec("pre-commit --version") + cmd = "pre-commit run --all-files" + end, + catch { function() end } + } + if not cmd then + local python = "python3" + try { + function() + os.exec("python --version") + python = "python" + end, + catch { function() end } + } + cmd = python .. " -m pre_commit run --all-files" + end + print(os.exec(cmd)) end) task("sln") |