-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multiple boot strap files, including with os/template matching #286
Comments
Put the files in your bootstrap.d directory and use the regular alternate mechanism like: To get syntax highlighting to work you can, with 3.0.0, name the files |
oh cool, can't wait until the 3.0.0 update comes to AUR. wait the alternate syntax will already work in that directory?. |
According to https://aur.archlinux.org/packages/yadm it's already there. You can use the alternate syntax in any directory tracked by yadm. |
huh, didn't know that, pretty sure it wasn't last night when I was updating stuffs |
hmm.. I don't see this stuff documented on the alternates or templates page.
but how does it know where the files go? afaik there's no header to define location, so I kind of assume in this case the path for the alternates would have to be
|
I was thinking something like this: Let #!/bin/sh
BOOTSTRAP_D="$HOME/.config/yadm/bootstrap.d"
if [ ! -d "$BOOTSTRAP_D" ]; then
exit 0
fi
cd "$BOOTSTRAP_D"
if [ "$(echo *.sh)" = "*.sh" ]; then
exit 0
fi
for bootstrap in *.sh; do
test -x $bootstrap && ./$bootstrap
done The create the files you want to run, e.g.:
Make sure that bootstrap and all files in bootstrap.d are executable. Also add and commit them with yadm. I haven't actually tested the above, but I think it should work. |
I think bootstrap scripts expect to be run from the home directory, so I added the |
True. Or more so I think they are expected to be run from the same directory as the main bootstrap script (which may be different from
Another good point. Thanks @rasa! I put together something more "official" and submitted it in #287 as a contrib bootstrap script. It uses |
@xenoterracide: are you happy with the bootstrap script that's now available in the contrib directory? |
it's fine, though I wonder if it should make the missing directory instead of error, but that's not a big deal to me, and probably makes debugging easier. Also not sure if mkdir works on windows these days... |
I think yadm should just load all files that because with
bootstrap
starting withbootstrap
itself, but continuing with the same order as anetc.d
directory (or maybe there should be abootstrap.d
) obviously I could probably just do this myself, but the killer feature that makes that harder is wanting to have files that only execute on certain OS's, I figure the extension##foo
though I wish we could dofile##foo.sh
for syntax highlighting. I do know their are other simple ways to accomplish this, I could simply write the loop myself, and probably will consider it for now. I could have the templates install another file based on OS :P.The text was updated successfully, but these errors were encountered: