From db41cc80952ce065547634f53ac16d35e4b1cb7a Mon Sep 17 00:00:00 2001 From: Jeffrey Schang Date: Mon, 8 Apr 2024 15:12:58 +0200 Subject: [PATCH] use a different extension 'dsymlink' so bootstrap can link any file inside a .directory --- gnupg/{gpg.conf.symlink => gpg.conf.dsymlink} | 0 script/bootstrap | 10 +++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) rename gnupg/{gpg.conf.symlink => gpg.conf.dsymlink} (100%) diff --git a/gnupg/gpg.conf.symlink b/gnupg/gpg.conf.dsymlink similarity index 100% rename from gnupg/gpg.conf.symlink rename to gnupg/gpg.conf.dsymlink diff --git a/script/bootstrap b/script/bootstrap index b15f3d86a86..5e3d96716d6 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -136,9 +136,13 @@ install_dotfiles () { link_file "$src" "$dst" done - src=$DOTFILES_ROOT/gnupg/gpg.conf.symlink - dst=$HOME/.gnupg/gpg.conf - link_file "$src" "$dst" + # find files with '.dsymlink' and link to a file inside a .directory + # e.g. './gnupg/gpg.conf.dsymlink' links to '~/.gnupg/gpg.conf' + for src in $(find -H "$DOTFILES_ROOT" -maxdepth 2 -name '*.dsymlink' -not -path '*.git*') + do + dst="$HOME/.$(basename $(dirname $src))/$(basename "${src%.*}")" + link_file "$src" "$dst" + done }