The xargs -r flag prevents it from running if it receives no input and prevents error messages when there are no branches to be pruned.

snailed 2024-02-21 10:51:19 +01:00
parent 3b8812e1c4
commit fdb604729e

@ -141,7 +141,7 @@ customCommands:
```yml
customCommands:
- key: "b"
command: "git branch --merged master | grep -v '^[ *]*master$' | xargs git branch -d"
command: "git branch --merged master | grep -v '^[ *]*master$' | xargs -r git branch -d"
context: "localBranches"
loadingText: "Pruning..."
description: "prune local branches that have been merged to master"