holman / dotfiles

@holman does dotfiles
http://zachholman.com/2010/08/dotfiles-are-meant-to-be-forked/
MIT License
7.24k stars 3.35k forks source link

Question: Symlink into a subdirectory of home - e.g. ~/.aws/config #380

Open bradical opened 3 months ago

bradical commented 3 months ago

I was wondering if you had any suggestions for symlinking a config file into a subdirectory of a .dot directory in home, specifically .aws files?

Is there any capacity to do this already with the current .symlink behavior?

redhotvengeance commented 3 months ago

Speaking personally, I add a link.sh to each folder that has more complicated linking needs. And then I have a script/link script to run all of them: https://github.com/redhotvengeance/dotfiles/blob/fe8be45f7c38a098f104a8cf0c6f6a61c9901d0a/script/link#L25

bradical commented 3 months ago

Clever. Thanks! So this could create the ~/.aws directory if didn't exist and add a config file.

redhotvengeance commented 3 months ago

@bradical Yep. Check out one of my link.sh files that does several actions: https://github.com/redhotvengeance/dotfiles/blob/main/nvim/link.sh

schangj09 commented 3 months ago

Hey, This is pretty nice. I also wanted to make links in directories and I took a different approach. My idea is to use a different extension '.dsymlink' and update bootstrap so that it links those files into a sub-directory of home. https://github.com/schangj09/dotfiles/commit/db41cc80952ce065547634f53ac16d35e4b1cb7a

Note: I didn't test it much, so for example, I'm not sure what happens when the directory doesn't exist, but it should be easy to fix if needed.