From 04a6d51edc57f56ab306e22e3a66523956b525c9 Mon Sep 17 00:00:00 2001 From: Levi Bostian Date: Fri, 24 May 2024 07:02:35 -0500 Subject: [PATCH] feat: expand Swift integration with Mint support (#724) --- docs/install.md | 10 +++++++++- internal/templates/hook.tmpl | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/install.md b/docs/install.md index c569ee79..163ba47c 100644 --- a/docs/install.md +++ b/docs/install.md @@ -73,12 +73,20 @@ python3 -m pip install --user lefthook ## Swift -You can find the Swift wrapper plugin [here](https://github.com/csjones/lefthook-plugin). To utilize lefthook, include the plugin in the dependencies section of your `Package.swift`: +You can find the Swift wrapper plugin [here](https://github.com/csjones/lefthook-plugin). + +Utilize lefthook in your Swift project using Swift Package Manager: ```swift .package(url: "https://github.com/csjones/lefthook-plugin.git", exact: "1.6.12"), ``` +Or, with [mint](https://github.com/yonaskolb/Mint): + +```bash +mint run csjones/lefthook-plugin +``` + ## Scoop for Windowss ```sh diff --git a/internal/templates/hook.tmpl b/internal/templates/hook.tmpl index 76e608dd..f25f3dde 100644 --- a/internal/templates/hook.tmpl +++ b/internal/templates/hook.tmpl @@ -64,6 +64,9 @@ call_lefthook() elif swift package plugin lefthook >/dev/null 2>&1 then swift package --disable-sandbox plugin lefthook "$@" + elif command -v mint >/dev/null 2>&1 + then + mint run csjones/lefthook-plugin "$@" elif command -v npx >/dev/null 2>&1 then npx lefthook "$@"