Commit 60fa053ec834d38455970caa201177aed2abf57c
1 parent
42d76e5891
Add tests for url resolver and fix ssh urls.
All supported syntexes for a repo url are now tested. The ssh url of github was failing the test, so that is also fixed in this commit.
Showing 3 changed files with 30 additions and 2 deletions Side-by-side Diff
Makefile
antigen.zsh
... | ... | @@ -64,7 +64,11 @@ antigen-bundle () { |
64 | 64 | |
65 | 65 | local url="$1" |
66 | 66 | |
67 | - if [[ $url != git://* && $url != https://* && $url != /* ]]; then | |
67 | + if [[ $url != git://* && \ | |
68 | + $url != https://* && \ | |
69 | + $url != /* && \ | |
70 | + $url != git@github.com:*/* | |
71 | + ]]; then | |
68 | 72 | url="${url%.git}" |
69 | 73 | url="https://github.com/$url.git" |
70 | 74 | fi |
tests/url-resolver.t
... | ... | @@ -0,0 +1,24 @@ |
1 | +Helper alias. | |
2 | + | |
3 | + $ alias resolve=-antigen-resolve-bundle-url | |
4 | + | |
5 | +Complete urls. | |
6 | + | |
7 | + $ resolve https://github.com/zsh-users/antigen.git | |
8 | + https://github.com/zsh-users/antigen.git | |
9 | + $ resolve git://github.com/zsh-users/antigen.git | |
10 | + git://github.com/zsh-users/antigen.git | |
11 | + $ resolve git@github.com:zsh-users/antigen.git | |
12 | + git@github.com:zsh-users/antigen.git | |
13 | + | |
14 | +Just username and repo name. | |
15 | + | |
16 | + $ resolve zsh-users/antigen | |
17 | + https://github.com/zsh-users/antigen.git | |
18 | + $ resolve zsh-users/antigen.git | |
19 | + https://github.com/zsh-users/antigen.git | |
20 | + | |
21 | +Local absolute file path. | |
22 | + | |
23 | + $ resolve /path/to/a/local/git/repo | |
24 | + /path/to/a/local/git/repo |