Skip to content

Commit

Permalink
Some refactoring and more tests to url resolver.
Browse files Browse the repository at this point in the history
  • Loading branch information
sharat87 committed Jul 18, 2012
1 parent a5e21a6 commit 1cae4fc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions antigen.zsh
Expand Up @@ -69,13 +69,13 @@ antigen-bundle () {

local url="$1"

# Expand short github url syntax: `username/reponame`
if [[ $url != git://* && \
$url != https://* && \
$url != /* && \
$url != git@github.com:*/*
]]; then
url="${url%.git}"
url="https://github.com/$url.git"
url="https://github.com/${url%.git}.git"
fi

echo "$url"
Expand Down
9 changes: 9 additions & 0 deletions tests/url-resolver.t
Expand Up @@ -11,6 +11,15 @@ Complete urls.
$ resolve git@github.com:zsh-users/antigen.git
git@github.com:zsh-users/antigen.git

Complete github urls, missing the `.git` suffix.

$ resolve https://github.com/zsh-users/antigen
https://github.com/zsh-users/antigen
$ resolve git://github.com/zsh-users/antigen
git://github.com/zsh-users/antigen
$ resolve git@github.com:zsh-users/antigen
git@github.com:zsh-users/antigen

Just username and repo name.

$ resolve zsh-users/antigen
Expand Down

0 comments on commit 1cae4fc

Please sign in to comment.