I have an enhancement to propose: Allowing an if property (which would work just like the link option) on the top-level tasks, alongside each directive. If the executed command is not successful, the whole task would be skipped.
The idea is that you could define sets of links, or shell commands, or whatever task, for an environment/profile/whatever. My use case is that I'd like to have a task with links that are always created, and then another set just for personal machines, and a third just for work machines. I have a different .gitconfig file between the two, plus a .pairs file for work, plus more...Since I can't put two different entries for the same file under a single link task, I need to have different task for these cases, anyway. So, it would be wonderful if I didn't have to repeat the same if option again and again and again.
For exmaple:
- link:
# all my common links
- if: [[ ! $PROFILE ]]
link:
~/.gitconfig:
- if: [[ $PROFILE = work ]]
link:
~/.gitconfig: gitconfig.work
~/.pairs
# other work-only links
Plus, I could imagine this being useful with other directives -- definitely for shell and create, and probably for many plugins, too.
I think this small enhancement would make dotbot so much more flexible and powerful.
I have an enhancement to propose: Allowing an
ifproperty (which would work just like thelinkoption) on the top-level tasks, alongside each directive. If the executed command is not successful, the whole task would be skipped.The idea is that you could define sets of
links, orshellcommands, or whatever task, for an environment/profile/whatever. My use case is that I'd like to have a task withlinks that are always created, and then another set just for personal machines, and a third just for work machines. I have a different.gitconfigfile between the two, plus a.pairsfile for work, plus more...Since I can't put two different entries for the same file under a singlelinktask, I need to have different task for these cases, anyway. So, it would be wonderful if I didn't have to repeat the sameifoption again and again and again.For exmaple:
Plus, I could imagine this being useful with other directives -- definitely for
shellandcreate, and probably for many plugins, too.I think this small enhancement would make dotbot so much more flexible and powerful.