From 71131a52b95e98fb90a7103651f03d318d996d7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20P=C5=82azie=C5=84ski?= Date: Fri, 29 Sep 2023 11:44:47 +0200 Subject: [PATCH] Add broot function --- zshrc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/zshrc b/zshrc index 7924103..ba89fb8 100644 --- a/zshrc +++ b/zshrc @@ -706,3 +706,18 @@ if ! zplug check --verbose; then fi 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 +} +