TheLocehiliosan / yadm

Yet Another Dotfiles Manager
https://yadm.io/
GNU General Public License v3.0
4.94k stars 178 forks source link

difficulty understanding docs re alternates #379

Closed CouldBeThis closed 2 years ago

CouldBeThis commented 2 years ago

This question is about

Describe your question

The documentation for alternates says (and is elaborated upon in the man page):

Alternate linking may best be demonstrated by example. Assume the following files are managed by yadm’s repository:

$HOME/path/example.txt##default
$HOME/path/example.txt##class.Work
$HOME/path/example.txt##os.Darwin
$HOME/path/example.txt##os.Darwin,hostname.host1
$HOME/path/example.txt##os.Darwin,hostname.host2
$HOME/path/example.txt##os.Linux
$HOME/path/example.txt##os.Linux,hostname.host1
$HOME/path/example.txt##os.Linux,hostname.host2

I do not think I am understanding this. As I interpret the above, if I have a simple situations of 2 machines, one which is Linux, one which is Mac I would create the following files

??? surely not

I am finding the example.txt example confusing because it does not demonstrate a realistic use case. Perhaps an example of a usual config file with typical file locations would be helpful. I think something very simple using fewer attributes would get the job done.

I looked through the Example Dotfiles but none of them are sharing the .config/yadm/config file either at all or in detail, probably because it would be a bad idea.

I did look around the web and reddit for further explanation but wasn't able to find anything.

thanks for your time in the project generally and in reading/responding to this question.

primeapple commented 2 years ago

There can always be only one (or none) file being created by the alternate file syntax.

Your three .zshrc files should be called: ~/.zshrc##default ~/.zshrc##os.Darwin ~/.zshrc##os.Linux

Now on your Linux System the file .zshrc will be symlinked to ~/.zshrc##os.Linux. On the Mac System it is linked to ~/.zshrc##os.Darwin. On any other system it will be linked to ~/.zshrc##default.

If you don't want multiple files for multiple systems, try using templates. I personally don't like them because the don't symlink the created file, but create it from scratch. So changes to this file are not picked up into the template file.

Lastly there are examples outside like: https://yadm.io/docs/examples I'm also working on getting mine public, it will just take a while :)

github-actions[bot] commented 2 years ago

This issue has been labeled as stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 2 years ago

This issue was closed because it has been labeled as stale for 7 days with no activity.