zsh-snap
zsh-snap copied to clipboard
Allow git repos to be submodules
I'm using yadm and would like to track the plugins as submodules of the yadm repository. When checking out such a submodule, .git is not a directory, but rather a file. This resulted in the following error, for each of the plugins that I track as a submodule:
% exec zsh
.znap.source:16: no directory expansion: ~[superbrothers/zsh-kubectl-prompt]
.znap.source:16: no directory expansion: ~[mattmc3/zfunctions]
.znap.source:16: no directory expansion: ~[olets/zsh-abbr]
.znap.source:16: no directory expansion: ~[Aloxaf/fzf-tab]
With this commit ..znap.repos and ..znap.dirname handle that case. Please note that there are other checks in some of the scripts that do also check for a .git directory. They may still need to be changed.
Before submitting your Pull Request (PR), please check the following:
- [x] There is no other PR (open or closed) similar to yours. If there is, please first discuss over there.
- [x] Your new code in each file follows the same style as the existing code in that file.
- [x] Each commit messages follows the Seven Rules of a Great Commit Message.
- [ ] Each commit message includes
Fixes #<bug>
orResolves #<issue>
in its body (not subject, that is, the first line) for each issue it resolves (if any). - [x] You have squashed any redundant or insignificant commits.