CodelyTV / dotly

🌚 Modular and easy to customize dotfiles framework
https://codely.com/cursos
MIT License
1.19k stars 116 forks source link

dot command error: "find: -perm: /+111: illegal mode string" #189

Closed alexgraupera closed 1 year ago

alexgraupera commented 2 years ago

When I run the dot command I get the error find: -perm: / + 111: illegal mode string and the dot (fzf) contextual help shows empty

Code location: https://github.com/CodelyTV/dotly/blob/9b11497e19f7d6b3ce4c54463b7d3d2f05e4518e/scripts/core/dot.sh#L28

If I try removing the "/" character from "-perm" parameter the find command is executed without errors and return the right information (scripts path)

dotfiles installed and executed in macOS BigSur v11.6

alexgraupera commented 2 years ago

I think I found the issue cause.

For some reason I was not using the gfind of the findutils installed from homebrew

Solved running this command: ln -sf ../Cellar/findutils/4.8.0_1/bin/gfind /usr/local/bin/find

With this gfind version the slash "/" char in -perm parameter works fine

Is there a way to fix all possible problems with homebrew installations symlinks? I tried with a brew upgrade or brew upgrade findutils but it didn't work

3d24rd0 commented 2 years ago

fixed for my with ln command ln -sf /usr/local/Cellar/findutils/4.9.0/bin/gfind /usr/local/bin/find

I think the problem is because there is not exist gfind inside /opt/homebrew/bin/ so the default configuration provided of the symbolic links is not valid.

gtrabanco commented 2 years ago

Not all installations of Brew have the same path... A solution could be:

brew unlink findutils
brew link findutils 

If you want the findutils path: brew --prefix findutils would be better or use HOMEBRE_PREFIX

3d24rd0 commented 2 years ago

on a new installation I solved it by replacing

path+=(
"paths"
)

for

path=(
"paths"
$path
)
Ceres6 commented 1 year ago

I'm having the same problem. Shouldn't this be fixed in the repo? #220 solves it for me but I don't see any progress on that PR

fabriziofs commented 1 year ago

I have the same issue and I think the problem is the version of find command that is been used.

Without make any change:

<▸> ~ which find
/usr/bin/find
<▸> ~ ls -lah /usr/bin/ | grep find
-rwxr-xr-x    1 root   wheel   199K 28 oct 10:43 find

The find command aims to /usr/bin/find


After applying the changes made in #220 PR:

<▸> ~ which find
/Users/username/bin/find
<▸> ~ ls -lah ~/bin | grep find
lrwxr-xr-x   1 username  staff    23B  4 dic 02:20 find -> /opt/homebrew/bin/gfind

So, for fixing this issue I think you need to made the changes needed to use gfind installed by Homebrew instead of the default one store in /usr/bin/find. (In my case, is aplying the changes in #220)

Why some of us have this issue and is not set the correct version of find by default? Who knows 🤷‍♂️

brtbrt commented 1 year ago

as @fabriziofs says, that fixed the issue 😉

rgomezcasas commented 1 year ago

Closing since it's fixed in https://github.com/CodelyTV/dotly/pull/220 🙂

Thanks everybody for reporting and fixing!