Add `prefix:` option to links created with `glob: true`
See original GitHub issuePerhaps this is a niche case, but in my dotfiles
, I have a subdirectory for most of the true “dot” files. i.e.:
dotfiles
├── README.md
├── bin
│ ├── dotbot
│ ├── look
│ ├── pbfile
│ └── ...
├── dot
│ ├── bashrc
│ ├── gitconfig
│ ├── gitignore
│ ├── gorc
│ ├── login
│ ├── ...
│ ├── zshrc
│ └── zshenv
├── ...
I don’t believe there is a way using the link:
module to create symlinks in my home directory for all the files in the dot
subdirectory, sans excluded ones, given #248 when merged.
That is, what I want is to replace the MANY lines in my dotconf.yml
like this:
- link:
# Then everything in dot subdir:
# Wish I could do this via a glob
~/.bashrc: dot/bashrc
~/.gitconfig: dot/gitconfig
~/.gitignore: dot/gitignore
...
… with a glob version, something like this:
- link:
~/:
glob: true
path: ~/.dotfiles/dot/*
prefix: '.'
Note the addition of the prefix:
option which specifies the prefix to be added to the basename of the file to be symlinked.
Alternatives welcome, or if I missed something in the documentation for how this should be configured, a pointer to the documentation.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Set up a custom domain for Dynamic Links - Firebase
If you haven't used Dynamic Links before, click Get Started. Otherwise, click Add URL prefix from the drop-down menu. Then, complete the setup...
Read more >Python glob multiple filetypes - Stack Overflow
glob returns a list: why not just run it multiple times and concatenate the ... you can pass recursive=True and use the multi-directory...
Read more >npm-link
Package linking is a two-step process. First, npm link in a package folder with no arguments will create a symlink in the global...
Read more >Built-in options - The Meson Build system
Meson provides two kinds of options: build options provided by the build files and built-in options that are either universal options, base options, ......
Read more >Working With Files in Python
In this tutorial, you'll learn how to: Retrieve file properties; Create directories; Match patterns in filenames; Traverse directory trees; Make temporary files ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
thanks @etkeys - I saw that issue/PR, but I think my case is the dual of that. In my case, none of my config files have leading
.
when stored in my git repo. Instead, I want to add the leading period when the links are created viadotbot
. Ideally, I would NOT have to store them in git with leading periods, as that makes editing / etc more difficult, IMO.Separately, thanks for sharing your config file example - my goodness, there’s quite a lot in there. In our environment, which I lead and manage, we use
ansible
to configure the system. I’m looking atdotbot
just for my personal configuration. If yours is for personal system config, that might be overkill, but if you start to manage many systems, even just a small handful, I really would look atansible
.Not yet, will try to take a look later this week or over the weekend.