AutoYADM commit: 2025-07-18 17:49:45
This commit is contained in:
parent
747fd2cb57
commit
bb0fb275a6
2 changed files with 34 additions and 1 deletions
|
@ -11,6 +11,21 @@ provide-module local-kakrc %—
|
|||
}
|
||||
}
|
||||
|
||||
define-command local-kakrc-load-if-trusted %{
|
||||
# first we check if the .kakrc exists
|
||||
evaluate-commands %sh{
|
||||
if [ -f .kakrc ]; then
|
||||
notify-send "Found it!"
|
||||
# check if it's a trusted dir
|
||||
if grep -q "$PWD" "$kak_opt_local_kakrc_trusted"; then
|
||||
echo "source .kakrc"
|
||||
else
|
||||
echo "info -title 'local-kakrc' 'Local .kakrc found, but directory is untrusted.'"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
}
|
||||
|
||||
define-command -params 0..1 local-kakrc-add-trusted %{
|
||||
nop %sh{
|
||||
if [ "$#" -eq 0 ]; then
|
||||
|
@ -18,7 +33,23 @@ provide-module local-kakrc %—
|
|||
else
|
||||
arg="$(realpath "$1")"
|
||||
fi
|
||||
notify-send "$arg"
|
||||
echo "local-kakrc-ensure-file">"$kak_command_fifo"
|
||||
printf '%s\n' "$arg">"$kak_opt_local_kakrc_trusted"
|
||||
}
|
||||
}
|
||||
|
||||
define-command -params 0..1 local-kakrc-rm-trusted %{
|
||||
evaluate-commands %sh{
|
||||
if [ "$#" -eq 0 ]; then
|
||||
arg="$PWD"
|
||||
else
|
||||
arg="$(realpath "$1")"
|
||||
fi
|
||||
if [ ! -f "$kak_opt_local_kakrc_trusted" ]; then
|
||||
echo "fail local_kakrc_trusted not found!"
|
||||
exit 1
|
||||
fi
|
||||
printf '%s\n' "$arg">"$kak_opt_local_kakrc_trusted"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue