AutoYADM commit: 2025-07-18 18:05:11
This commit is contained in:
parent
bb0fb275a6
commit
360560fd2b
1 changed files with 13 additions and 5 deletions
|
@ -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"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue