Skip to content

Commit

Permalink
feat: Initial support for Swift Plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
csjones committed Sep 24, 2023
1 parent b67182f commit 3dd45a1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Choose your fighter:
- [Node.js](#node)
- [Go](#go)
- [Python](#python)
- [Swift](#swift)
- [Scoop](#scoop)
- [Homebrew](#homebrew)
- [Winget](#winget)
Expand Down Expand Up @@ -70,6 +71,14 @@ You can find Python wrapper here [package](https://github.com/life4/lefthook)
python3 -m pip install --user lefthook
```

## <a id="swift"></a> 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`:

```swift
.package(url: "https://github.com/csjones/lefthook-plugin.git", exact: "1.5.0"),
```

## <a id="scoop"></a> Scoop for Windowss

```sh
Expand Down
3 changes: 3 additions & 0 deletions internal/templates/hook.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ call_lefthook()
elif command -v npx >/dev/null 2>&1
then
npx @evilmartians/lefthook "$@"
elif swift package plugin lefthook >/dev/null 2>&1
then
swift package --disable-sandbox plugin lefthook $@
else
echo "Can't find lefthook in PATH"
{{- if .AssertLefthookInstalled}}
Expand Down

0 comments on commit 3dd45a1

Please sign in to comment.