Closed Subjective closed 10 months ago
Hmmm, I'm not entirely sure why the ci/cd build fails for macOS, it seems to work locally on my own system
Hmmm, I'm not entirely sure why the ci/cd build fails for macOS, it seems to work locally on my own system
nevermind, I'll fix it later
It seems like the shell detection message is always outputed when generating shell completions, regardless of whether the user provided a shell or not. The issue is that the println() is always being executed when it is inside the closure provided to the
unwrap_or
, event when a valid shell is provided. I'm not familiar with rust, so I don't know why this is the case.More importantly though, even if the message is ouptuted correctly, it actually prevents the completion from detected correctly (at least for zsh) when added to a file in the fpath like so:
$ leetcode completions zsh >! /usr/local/share/zsh/site-functions/_leetcode
That line has to be manually deleted since it comes before
#compdef leetcode
For these reasons, I think it would be best to just not output it at all and include that info in the README.
If you would prefer to keep the detection message, the following snippet will correctly output the message at the end of the file, but is no where near as elegant.
Let me know what you think. Thanks.