Skip to content
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

Possibility to use vars instead of absolute paths when using certain location features #257

Open
telometto opened this issue Nov 30, 2022 · 0 comments

Comments

@telometto
Copy link

Is your feature request related to a problem? Please describe.
It doesn't seem to be possible to use variables along with certain options, like exclude_dirs.

E.g. this works:

folderpath: &mypath
  - "/run/media/myuser/samsung/"

excl_dirs: &excldirs
  - "github"
  - "backups"

rules:
  - name: "Finding audio"
    locations: *mypath
    subfolders: true
    filters:
        - extension
            - *aud
    actions:
        - echo: "File: {relative_path}"

This doesn't (it keeps asking for a [str]):

folderpath: &mypath
  - "/run/media/myuser/samsung/"

excl_dirs: &excldirs
  - "github"
  - "backups"

rules:
  - name: "Finding audio"
    locations:
      - path: *mypath
        exclude_dirs: *excldirs
    subfolders: true
    filters:
        - extension
            - *aud
    actions:
        - echo: "File: {relative_path}"

In order for that to work, you have to provide an absolute path:

rules:
  - name: "Finding audio"
    locations:
      - path: "/run/media/myuser/samsung/"
        exclude_dirs:
          - "github"
          - "backups"
    subfolders: true
    filters:
        - extension
            - *aud
    actions:
        - echo: "File: {relative_path}"

Describe the solution you'd like
Just the possibility to use variables instead of having to use absolute paths 😊

Describe alternatives you've considered
I'm just making do with the available options

Additional context
It could very well be that it is I that's doing something wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant