From 1d9a2fcf78315e74864b897940c8476327f58433 Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Sat, 19 Jul 2025 00:08:39 -0400 Subject: [PATCH] AutoYADM commit: 2025-07-19 00:08:39 --- .config/kak/autoload/local-kakrc.kak | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.config/kak/autoload/local-kakrc.kak b/.config/kak/autoload/local-kakrc.kak index 0bc508e3..20b73c02 100644 --- a/.config/kak/autoload/local-kakrc.kak +++ b/.config/kak/autoload/local-kakrc.kak @@ -12,9 +12,14 @@ provide-module local-kakrc %— # ensures that the file exists define-command -hidden local-kakrc-ensure-file %{ nop %sh{ - if [ ! -f "$kak_opt_local_kakrc_trusted" ]; then - mkdir -p "$kak_opt_local_kakrc_trusted" - touch "$kak_opt_local_kakrc_trusted" + file="$kak_opt_local_kakrc_trusted" + dir="$(dirname "$file")" + if [ ! -f "$file" ]; then + [ ! -d "$dir" ] || mkdir -p "$dir" + base="$(basename "$file")" + # add to gitignore by default + printf '%s\n' "$base" >>"$dir/.gitignore" + touch "$file" fi } }