Add broot function

This commit is contained in:
Paweł Płazieński 2023-09-29 11:44:47 +02:00
parent cea5deea4a
commit 71131a52b9

15
zshrc
View File

@ -706,3 +706,18 @@ if ! zplug check --verbose; then
fi fi
zplug load zplug load
#---------------------------------- Broot ------------------------------------
function br {
local cmd cmd_file code
cmd_file=$(mktemp)
if broot --outcmd "$cmd_file" "$@"; then
cmd=$(<"$cmd_file")
command rm -f "$cmd_file"
eval "$cmd"
else
code=$?
command rm -f "$cmd_file"
return "$code"
fi
}