-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add
exec
CLI command to simplify executing scripts (#135)
- Add `git hooks exec` command to launch executables and run configuration the same as Githooks executes when run normally. This features simplifies executing add-on scripts/executables distributed in shared hook repositories (and also locally with `ns:gh-self`). For example execute the following [add-on 'format-all' script](https://github.com/gabyx/Githooks-Docs/blob/main/githooks/scripts/format-docs-all.yaml) with: ```shell git hooks exec --containerized \ ns:githooks-docs/scripts/format-docs-all.yaml -- \ --force \ --dir ./ ``` This will launch the specified container and run the script. **Note**: You need to have configured this shared repository inside your repo where you use Githooks.
- Loading branch information
Showing
55 changed files
with
1,036 additions
and
296 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
use flake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.DS_Store | ||
.direnv/ | ||
cover/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
local dap = require("dap") | ||
|
||
dap.adapters.delve = { | ||
type = "server", | ||
port = "${port}", | ||
executable = { | ||
command = "dlv", | ||
args = { "dap", "-l", "127.0.0.1:${port}" }, | ||
options = { | ||
env = { | ||
GOPATH = "${workspaceFolder}/githooks/.go", | ||
GOBIN = "${workspaceFolder}/githooks/bin", | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
dap.configurations.go = { | ||
-- This are the requests documented here: | ||
-- https://github.com/go-delve/delve/blob/master/Documentation/api/dap/README.md | ||
{ | ||
type = "delve", | ||
name = "[githooks] Debug", | ||
request = "launch", | ||
program = "${file}", | ||
}, | ||
|
||
-- works with go.mod packages and sub packages | ||
{ | ||
type = "delve", | ||
name = "[githooks] Debug Test (go.mod)", | ||
request = "launch", | ||
mode = "test", | ||
program = "${fileDirname}", | ||
|
||
-- Because we are in a subdirevtory, this is needed. | ||
dlvCwd = "githooks", | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
-- Load debug adapters in this project | ||
nvimdap = require("nvim-dap-projects") | ||
nvimdap.search_project_config() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.