mirror of
https://github.com/Cian-H/dotfiles.git
synced 2026-02-24 00:48:06 +00:00
This change allows the dotfiles to work with chezmoi (e.g: on windows) and improves grepability with neovim/telescope
15 lines
469 B
Nu
15 lines
469 B
Nu
#!/usr/bin/env nu
|
|
gh api $"orgs/($env.OWNER)/repos"
|
|
|from json
|
|
|each {|repo|
|
|
gh api $"repos/($env.OWNER)/($repo.name)/pulls?state=closed"
|
|
|from json
|
|
|if ($in|length) > 0 {
|
|
each {|pull|
|
|
print $"Removing branch ($pull.head.ref) from repo ($repo.name)"
|
|
gh api -X DELETE $"repos/($env.OWNER)/($repo.name)/git/refs/heads/($pull.head.ref)"
|
|
}
|
|
} else {
|
|
print $"Repo ($repo.name) has no branches to delete"
|
|
}
|
|
} |