SuperCuber / dotter

A dotfile manager and templater written in rust 🦀
The Unlicense
882 stars 46 forks source link

Condition on the destination path depending on the OS? #100

Closed sneko closed 2 years ago

sneko commented 2 years ago

Hi,

The Visual Studio Code settings.json is set in total different locations depending on the OS as mentioned in https://stackoverflow.com/questions/44575312/change-vscode-user-settings-location

I saw @SuperCuber you mentioned some conditioning possible but how to do it to check the OS platform, and adjust the destination path?

Any example would be appreciated :)

Thank you,

SuperCuber commented 2 years ago

Take my dotfiles as an example - my global.toml and this is the file I include on my windows machine windows.toml

There's no automatic conditioning, I just add includes = [".dotter/include/windows.toml"] in my local.toml

sneko commented 2 years ago

Since local.toml is .gitignored I guess you mean that people cloning my dotfiles repo should modify it to include their own OS file?

That's sad there is no way to automate this hmmmm

SuperCuber commented 2 years ago

There's also conditional files so you could use something like if = "(eq dotter.os 'windows')"

SuperCuber commented 2 years ago

Feel free to reopen if you still have questions