feat: Ajout support broot
This commit is contained in:
parent
0e58fa99f4
commit
1e20a91e84
23
rc.d/broot
Normal file
23
rc.d/broot
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if (command -v broot &>/dev/null); then
|
||||||
|
# This script was automatically generated by the broot program
|
||||||
|
# More information can be found in https://github.com/Canop/broot
|
||||||
|
# This function starts broot and executes the command
|
||||||
|
# it produces, if any.
|
||||||
|
# It's needed because some shell commands, like `cd`,
|
||||||
|
# have no useful effect if executed in a subshell.
|
||||||
|
function br {
|
||||||
|
local cmd cmd_file code
|
||||||
|
cmd_file=$(mktemp)
|
||||||
|
if broot --outcmd "$cmd_file" "$@"; then
|
||||||
|
cmd=$(<"$cmd_file")
|
||||||
|
rm -f "$cmd_file"
|
||||||
|
eval "$cmd"
|
||||||
|
else
|
||||||
|
code=$?
|
||||||
|
rm -f "$cmd_file"
|
||||||
|
return "$code"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user