feat(run-pre-commit): add script to run pre-commit in git folders and update documentation
This commit is contained in:
3 files changed
+27
-8
No files matched your search
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
run-pre-commit() {
|
||||
if [[ -z "$1" ]]; then echo "\$1/path is empty."; exit; fi
|
||||
local git_folders=$(ls-git-folder "$1")
|
||||
|
||||
echo 'Run pre-commit in git folders...'
|
||||
for git_folder in $git_folders; do
|
||||
cd "$git_folder"
|
||||
pre-commit run -a
|
||||
cd -
|
||||
done
|
||||
}
|
||||
+12
-7
@@ -317,7 +317,6 @@ rows+=("download-git-folder|[path]|Download git folder from .gitmodules file.")
|
||||
rows+=("find-git-folder|[path]|Find all .git folders in path.")
|
||||
```
|
||||
|
||||
|
||||
### list-git-folder
|
||||
|
||||
```bash
|
||||
@@ -336,12 +335,6 @@ rows+=("ls-git-folder|[path]|Space separated list of git folders from .gitmodule
|
||||
rows+=("pull-git-folder|[branch][path]|Pull all git folders from .gitmodules file.")
|
||||
```
|
||||
|
||||
### remove-git-folder
|
||||
|
||||
```bash
|
||||
rows+=("remove-git-folder|[path]|Remove git folders in path from .gitmodules file.")
|
||||
```
|
||||
|
||||
### switch-git-folder
|
||||
|
||||
```bash
|
||||
@@ -360,12 +353,24 @@ rows+=("sync-git-folder|[branch][path]|Switch, stash and pull all git folders fr
|
||||
rows+=("push-git-folder|[path]|Push all git folders from .gitmodules file.")
|
||||
```
|
||||
|
||||
### remove-git-folder
|
||||
|
||||
```bash
|
||||
rows+=("remove-git-folder|[path]|Remove git folders in path from .gitmodules file.")
|
||||
```
|
||||
|
||||
### reset-git-folder
|
||||
|
||||
```bash
|
||||
rows+=("reset-git-folder|[path]|Abort, rebase and reset git folders from .gitmodules file.")
|
||||
```
|
||||
|
||||
### run-pre-commit
|
||||
|
||||
```bash
|
||||
rows+=("run-pre-commit|[path]|Run pre-commit in path.")
|
||||
```
|
||||
|
||||
### stage-git-folder
|
||||
|
||||
```bash
|
||||
|
||||
+2
-1
@@ -56,11 +56,12 @@ help-table() {
|
||||
rows+=("list-git-folder|[path]|List path and url of git folders from .gitmodules file.")
|
||||
rows+=("ls-git-folder|[path]|Space separated list of git folders in path.")
|
||||
rows+=("pull-git-folder|[branch][path]|Pull all git folders from .gitmodules file.")
|
||||
rows+=("remove-git-folder|[path]|Remove git folders in path from .gitmodules file.")
|
||||
rows+=("switch-git-folder|[branch][path]|Switch branch for all git folders from .gitmodules file.")
|
||||
rows+=("sync-git-folder|[branch][path]|Switch, stash and pull all git folders from .gitmodules file.")
|
||||
rows+=("remove-git-folder|[path]|Remove git folders in path from .gitmodules file.")
|
||||
rows+=("push-git-folder|[path]|Push all git folders in path.")
|
||||
rows+=("reset-git-folder|[path]|Abort, rebase and reset git folder.")
|
||||
rows+=("run-pre-commit|[path]|Run pre-commit in path.")
|
||||
rows+=("stage-git-folder|[path]|Stage all files in git folders in path.")
|
||||
rows+=("status-git-folder|[path]|Show status of git folders in path.")
|
||||
rows+=("update-submodule||Update git submodules.")
|
||||
|
||||
Reference in new issue
Block a user