Can't seem to get it to work
Opened this issue · 2 comments
I followed the "zinit without zinit-annex-bin-gem-node" instructions and the script runs by itself but I can't seem to get it actually process a file correctly:
zsweep --auto zsh/get-icon-for-command.zsh
[ZSweep][zs::get-prj-dir:46]: Warning: didn't find any main poject dir uptree, was looking for: ·.git, ·TAGS, ·tags, ·CMakeLists.txt, ·configure
[ZSweep][zsweep:65]: Notice: scanning file: •ZSH/GET-ICON-FOR-COMMAND.ZSH•…
[ZSweep][zs::get-prj-dir:46]: Warning: didn't find any main poject dir uptree, was looking for: ·.git, ·TAGS, ·tags, ·CMakeLists.txt, ·configure
[ZSweep][zs::read-file:20]: Error: no input file given
[ZSweep][zsweep:75]: Warning: returning non-zero exit code
[ZSweep][zsweep:76]: Warning: the 1/1 failed files are:
·zsh/get-icon-for-command.zsh
I'm running that script from ~/dotfiles
which is a git repo. I traced through that problem and the if at functions/util/zs::get-prj-dir:32
evaluates as true but I don't understand why. This is what set -x
shows for that comparison:
[[ /Users/cam/dotfiles/.git == ([[:cntrl:][:space:][:INCOMPLETE:][:INVALID:]]#|*[[:INCOMPLETE:][:INVALID:]]*|[[:cntrl:]]#|0#|[^[:print:][:alnum:]]#) ]]
None of that explains the [ZSweep][zs::read-file:20]: Error: no input file given
error.
Any idea what might be going on?
I'm interested to see if it would be possible to get zsweep set up as a zsh linter in nvim via nvim-lint / mason. But I have to get it working first :) Any help much appreciated!
Did a little more digging and this is the comparison in zs::read-file
that's evaluating as true
even thought it doesn't seem like it should (line numbers off by one from GH src because i added a set -x
line):
+util/zs::read-file:20> [[ /Users/cam/dotfiles/zsh/get-icon-for-command.zsh == ([[:cntrl:][:space:][:INCOMPLETE:][:INVALID:]]#|*[[:INCOMPLETE:][:INVALID:]]*|[[:cntrl:]]#|0#|[^[:print:][:alnum:]]#) ]]
+util/zs::read-file:21> zsmsg_ zs::read-file:21 -h '{err}Error:{txt}' no input file given
I'm terrible at pattern matching but perplexity.ai says of that pattern:
The alternative [^[:print:][:alnum:]]# at the end allows for zero occurrences of non-printable, non-alphanumeric characters, which is true for any string (including your path).
Changing the last #
to a +
in WRONGSTR does seem to let it find the script (and the project directory):
-g:([[:cntrl:][:space:][:INCOMPLETE:][:INVALID:]]#|*[[:INCOMPLETE:][:INVALID:]]*|[[:cntrl:]]#|0#|[^[:print:][:alnum:]]+)