mirror of
https://gitea.com/mcereda/oam.git
synced 2026-03-05 00:14:25 +00:00
chore(git-all): improve python and shell versions
This commit is contained in:
19
snippets/git.fish
Normal file
19
snippets/git.fish
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env fish
|
||||
|
||||
function git-all
|
||||
if ! which -s parallel
|
||||
echo "GNU parallel not found" >&2
|
||||
return
|
||||
end
|
||||
|
||||
argparse -s 'c/command=' 'p/path=+' 'r/recursive' -- $argv
|
||||
or return
|
||||
|
||||
if test "$_flag_recursive" = '-r' || test "$_flag_recursive" = '--recursive'
|
||||
set repositories (find $_flag_path -type 'd' -name '.git' -exec dirname {} +)
|
||||
else
|
||||
set repositories $_flag_path
|
||||
end
|
||||
|
||||
parallel --color-failed --tagstring "{/}" "git -C {} $_flag_command" ::: $repositories
|
||||
end
|
||||
Reference in New Issue
Block a user