organize icon indicating copy to clipboard operation
organize copied to clipboard

[v2.0.8] Symbolic links are not detected by `filters.name.startswith`

Open andreoliwa opened this issue 3 years ago • 6 comments

Rule:

rules:
  - name: "Echo .bash files on the root"
    locations: ~/
    filters:
      - name:
          startswith: .bash
    actions:
      - echo: "{name}"

Output:

❯ organize run
organize 2.0.8
Config: "/Users/aa/Library/Application Support/organize/config.yaml"

⚙ Echo .bash files on the root ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
/Users/aa
  .bash_history
    - (echo) .bash_history

My root files (.bash_history is an actual file, the others are symlinks):

❯ ls -1 ~/.bash*
/Users/aa/.bash_history
/Users/aa/.bash_profile -> /Users/aa/dotfiles/roles/bash/files/.bash_profile.sh
/Users/aa/.bashrc -> /Users/aa/dotfiles/roles/bash/files/.bashrc.sh

andreoliwa avatar Feb 09 '22 18:02 andreoliwa

Symbolic links are skipped at the moment. If this is something people are interested in I'll add a switch 👌

tfeldmann avatar Feb 09 '22 18:02 tfeldmann

I found a workaround, but I think it's nice to have.

Also, it's not mentioned on the docs: https://organize.readthedocs.io/en/latest/filters/#name

andreoliwa avatar Feb 09 '22 18:02 andreoliwa

I'm interest, how do you work around this?

It's not only the name filter, symlinks are always skipped

tfeldmann avatar Feb 09 '22 18:02 tfeldmann

I'm off the pc for today but I'll add symlink support in the next days

tfeldmann avatar Feb 09 '22 18:02 tfeldmann

I'm interest, how do you work around this?

Oh, nothing magical... I just used the file directly and avoided the symlinks. 😬

rules:
  - name: "Echo .bash files on the root"
    locations: ~/
    filters:
      - name: .bash_history
    actions:
      - echo: "{name}"

andreoliwa avatar Feb 09 '22 19:02 andreoliwa

I ran into a similar issue trying to move a file to a symlink of a folder on Win 10. Organize creates a new folder instead with the same name.

xdhmoore avatar Jun 21 '22 18:06 xdhmoore