Conditional targets using ENV or hostname #76
Replies: 1 comment 3 replies
-
So I've thought about it, I think putting hostnames into file names might not be a good idea. With environment variables at least I can always just tell that it should be there and warn the user whenever they try to add a dotfile that needs this env var. With hostnames I can never assume that it ought to be there so I cannot tell you that your config is broken because you changed your hostname. There's no good way of doing this currently and I can't really think of an approach that I like, what I could think of right now is:
* there's a bug where if you have 2 groups sharing a directory that doesn't exist, tuckr won't create the directory so that it can share it, it will just symlink one into the other. This is something I need to get around to fixing but I'll to do a fairly big refactor to integrate it, in practice this bug is not very common so I've been putting it off while I work on other stuff. The short-term fix would be for you to just create said directory yourself before adding.
Thanks :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to extend the current conditional target _linux _macos with an additional one like #myPC or #RPi using a string placed in an ENV var like TUCKR_SUBGROUP and if that is not found the hostname like uname -n or similar?
I would like to have a setup script that can just do a tuckr add whatever and depending on the current computer a different file gets deployed. As all of these are macos the current _target won't work. Setting up a different ENV var would have the benefit to not only use this for different computers but also different styles like setting TUCKR_SUBGROUP to "full_colors" or similar and automatically have other configs linked (maybe even auto checked after something like tuckr recheck * or similar).
I currently checked many dotfile managers and in my opinion tuckr could become one of the best options.
Beta Was this translation helpful? Give feedback.
All reactions