question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add `prefix:` option to links created with `glob: true`

See original GitHub issue

Perhaps 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:closed
  • Created 3 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
eengstromcommented, Feb 9, 2021

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 via dotbot. 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 at dotbot 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 at ansible.

0reactions
anishathalyecommented, Apr 29, 2021

Not yet, will try to take a look later this week or over the weekend.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found