Comments (4)
@grasegger - Is using a symbolic link a possibility?
from yadm.
@TheLocehiliosan But how would I make sure the tracked symlink only gets created on darwin systems?
from yadm.
- Choose a central place you want the file to exist. For my example, I'll use
$HOME/.config/yadm/src/abc
. - This file should be added to your dotfiles repo.
- On the system where you want this file referenced by an system specific path do the following:
- Create a "fully qualitified" symlink to the file from step 1, in the desired location.
ln -s "$HOME/.config/yadm/src/abc" "$HOME/Library/Preferenes/abc"
- Move that new symlink under the .config/yadm/alt path, and name it using a template that will match the system. https://yadm.io/docs/alternates#
mv "$HOME/Library/Preferenes/abc" "$HOME/.config/yadm/alt/Library/Preferenes/abc##os.Darwin"
- Add that symlink to your dotfiles repo
yadm add "$HOME/.config/yadm/alt/Library/Preferenes/abc##os.Darwin"
- At this point, yadm should have created a symlink in your desired path, which points to the os.Darwin versions (which in turn points to the central version)
- Repeat this on the other system
ln -s "$HOME/.config/yadm/src/abc" "$HOME/.config/abc/abc.conf"
mv "$HOME/.config/abc/abc.conf" "$HOME/.config/yadm/alt/.config/abc/abc.conf##os.Linux"
yadm add "$HOME/.config/yadm/alt/.config/abc/abc.conf##os.Linux"
- The appropriate symlink will only be created on the systems that match the template you use.
I know this sounds a bit complicated, but the end result would look like this:
.config/yadm/alt/Library/Preferenes/abc##os.Darwin -> $HOME/.config/yadm/src/abc
.config/yadm/alt/.config/abc/abc.conf##os.Linux -> $HOME/.config/yadm/src/abc
.config/yadm/src/abc
Note: it's important to use fully qualitified symlinks on each system, because your different systems may very well have different $HOME paths.
from yadm.
- Choose a central place you want the file to exist. For my example, I'll use
$HOME/.config/yadm/src/abc
.- This file should be added to your dotfiles repo.
- On the system where you want this file referenced by an system specific path do the following:
- Create a "fully qualitified" symlink to the file from step 1, in the desired location.
ln -s "$HOME/.config/yadm/src/abc" "$HOME/Library/Preferenes/abc"
- Move that new symlink under the .config/yadm/alt path, and name it using a template that will match the system. https://yadm.io/docs/alternates#
mv "$HOME/Library/Preferenes/abc" "$HOME/.config/yadm/alt/Library/Preferenes/abc##os.Darwin"
- Add that symlink to your dotfiles repo
yadm add "$HOME/.config/yadm/alt/Library/Preferenes/abc##os.Darwin"
- At this point, yadm should have created a symlink in your desired path, which points to the os.Darwin versions (which in turn points to the central version)
- Repeat this on the other system
ln -s "$HOME/.config/yadm/src/abc" "$HOME/.config/abc/abc.conf"
mv "$HOME/.config/abc/abc.conf" "$HOME/.config/yadm/alt/.config/abc/abc.conf##os.Linux"
yadm add "$HOME/.config/yadm/alt/.config/abc/abc.conf##os.Linux"
- The appropriate symlink will only be created on the systems that match the template you use.
I know this sounds a bit complicated, but the end result would look like this:
.config/yadm/alt/Library/Preferenes/abc##os.Darwin -> $HOME/.config/yadm/src/abc
.config/yadm/alt/.config/abc/abc.conf##os.Linux -> $HOME/.config/yadm/src/abc
.config/yadm/src/abcNote: it's important to use fully qualitified symlinks on each system, because your different systems may very well have different $HOME paths.
This is brilliant, I kinda forgot about tracking a symlink with git and wouldn't have thought that yadm just treats them like files.
from yadm.
Related Issues (20)
- yadm.io is down. HOT 2
- yadm not applying git filter HOT 2
- Deleting symlinks when run under sudo HOT 3
- Fedora 39 repo HOT 2
- document how to check if a variable is unset HOT 2
- linux file being linked on darwin HOT 2
- Checkout files to $HOME worktree not working HOT 8
- Author identity unknown after setting the identity HOT 2
- vim tty bootstrap HOT 2
- Encryption, Secrets and Password Management Roadmap HOT 4
- Fedora 40 repo HOT 1
- How can I use multiple classes in default template? HOT 6
- env substitutions not occuring with default template processor HOT 2
- Makefile does not install completions HOT 2
- Env variables don't work in if-else-endif templates HOT 14
- Issue with bootstrap-in-dir and installing fisher HOT 4
- Full support for alternate directories (not just directories with a top-level tracked file) HOT 2
- How to stop yadm overwriting untracked files? HOT 1
- Fall back to ID if ID_LIKE is not available
- Winget support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yadm.