babarot / afx

📦 Package manager for CLI
https://babarot.me/afx/
MIT License
148 stars 6 forks source link

Support globbing in link.from #61

Open hoshsadiq opened 11 months ago

hoshsadiq commented 11 months ago

WHAT

In the docs, there is this example:

    - from: .
      to: $HOME/.tmux/plugins/tpm

where it links all files from the install (command?) directory to the individual links in the to directory. It would be nice to be able to link based on globbing.

WHY

As one specific example, exa specifies both exa.1 and exa_colors.5 in the same man directory. I'd like to link these to the relevant places within the man directories so that man can pick it up correctly. So I could do:

        - from: man/*.1
          to: ~/.local/share/man/man1/
        - from: man/*.5
          to: ~/.local/share/man/man5/

For exa it's easy to solve, since it's 2 single files, but there are cases where there are many man pages in the package.

hoshsadiq commented 11 months ago

Oh, it seems it sort of supports it but fails e.g. with:

  - name: eth-p/bat-extras
    owner: eth-p
    repo: bat-extras
    release:
      name: bat-extras
    command:
      link:
        - from: 'bin/*'

The result is:

[ERROR]: 1 error occurred:
        * 1 error occurred:
                * eth-p/bat-extras: failed to get command.link: 1 error occurred:
                        * too many files are matched in file glob