AutoYADM commit: 2025-07-18 18:05:11

This commit is contained in:
Daniel Fichtinger 2025-07-18 18:05:11 -04:00
parent bb0fb275a6
commit 360560fd2b

View file

@ -41,15 +41,23 @@ provide-module local-kakrc %—
define-command -params 0..1 local-kakrc-rm-trusted %{ define-command -params 0..1 local-kakrc-rm-trusted %{
evaluate-commands %sh{ evaluate-commands %sh{
if [ "$#" -eq 0 ]; then if [ "$#" -eq 0 ]; then
arg="$PWD" arg="$PWD"
else else
arg="$(realpath "$1")" arg="$(realpath "$1")"
fi fi
if [ ! -f "$kak_opt_local_kakrc_trusted" ]; then if [ ! -f "$kak_opt_local_kakrc_trusted" ]; then
echo "fail local_kakrc_trusted not found!" echo "fail local_kakrc_trusted not found!"
exit 1 exit 1
fi
temp="$(mktemp)"
touch "$temp"
if grep -vxF "$arg" "$kak_opt_local_kakrc_trusted" >"$temp"; then
mv -f "$temp" "$kak_opt_local_kakrc_trusted"
else
notify-send "this runs"
echo "info -title 'local-kakrc' 'No such trusted directory!'"
rm "$temp" 2>/dev/null
fi fi
printf '%s\n' "$arg">"$kak_opt_local_kakrc_trusted"
} }
} }