Skip to content

Commit

Permalink
Merge pull request zplug#330 from iladin/master
Browse files Browse the repository at this point in the history
Add gitlab support
  • Loading branch information
zplug-man authored Jan 18, 2017
2 parents 063d26f + 1a5ea5a commit 9819d03
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 10 deletions.
47 changes: 47 additions & 0 deletions base/sources/gitlab.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
__zplug::sources::gitlab::check()
{
__zplug::sources::github::check "$argv[@]"
}

__zplug::sources::gitlab::install()
{
__zplug::sources::github::install "$argv[@]"
}

__zplug::sources::gitlab::update()
{
__zplug::sources::github::update "$argv[@]"
}

__zplug::sources::gitlab::get_url()
{
local repo="$1" url_format

case "$ZPLUG_PROTOCOL" in
HTTPS | https)
# https://git::@gitlab.com/%s.git
url_format="https://git::@gitlab.com/${repo}.git"
;;
SSH | ssh)
# [email protected]:%s.git
url_format="[email protected]:${repo}.git"
;;
esac

echo "$url_format"
}

__zplug::sources::gitlab::load_plugin()
{
__zplug::sources::github::load_plugin "$argv[@]"
}

__zplug::sources::gitlab::load_command()
{
__zplug::sources::github::load_command "$argv[@]"
}

__zplug::sources::gitlab::load_theme()
{
__zplug::sources::github::load_theme "$argv[@]"
}
1 change: 1 addition & 0 deletions doc/guide/External-Sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ If there is a service/framework you want to install from that's not supported
by zplug (yet!), you can add your own. We call these "sources."
[GitHub](https://github.com), [Bitbucket](https://bitbucket.org), [GitHub
Gist](https://gist.github.com), GitHub releases,
[Gitlab](https://gitlab.com),
[oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh), and
[prezto](https://github.com/sorin-ionescu/prezto) are supported by default.
Sources are what you specify with the `from` tag (e.g. `from:bitbucket`), so
Expand Down
10 changes: 8 additions & 2 deletions doc/man/man1/zplug.1
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ Can manage everything
.IP \(bu 2.3
.\}
Zsh plugins/UNIX commands on
GitHub
GitHub,
Gitlab
and
Bitbucket
.RE
Expand Down Expand Up @@ -380,7 +381,7 @@ T}:T{
Specify the service from which you install
T}:T{
.sp
github,bitbucket,gh\-r,gist, oh\-my\-zsh,prezto,local (github)
github,gitlab,bitbucket,gh\-r,gist, oh\-my\-zsh,prezto,local (github)
T}:T{
.sp
from:gh\-r
Expand Down Expand Up @@ -764,6 +765,11 @@ zplug "b4b4r07/hello_bitbucket", \e
hook\-build:"chmod 755 *\&.sh", \e
use:"*\&.sh"

# Support Gitlab
zplug "willemmali-sh/chegit", \e
as:command, \e
from:gitlab

# Group dependencies, emoji\-cli depends on jq in this example
zplug "stedolan/jq", \e
as:command, \e
Expand Down
2 changes: 1 addition & 1 deletion doc/man/man5/zplug-from.5
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ T}
lt lt.
T{
.sp
github, bitbucket, gh\-r, gist, oh\-my\-zsh, local
github, gitlab, bitbucket, gh\-r, gist, oh\-my\-zsh, local
T}:T{
.sp
github
Expand Down
8 changes: 4 additions & 4 deletions doc/txt/zplug-from.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ will be installed as the plugin or as the command.
.zplug from tag
[options="header"]
|================================================================
| Possive Values | Default value
| github, bitbucket, gh-r, gist, oh-my-zsh, local | github
|================================================================
|=========================================================================
| Possive Values | Default value
| github, gitlab, bitbucket, gh-r, gist, oh-my-zsh, local | github
|=========================================================================
Besides, by using `zstyle` command, you can change default value:
Expand Down
9 changes: 7 additions & 2 deletions doc/zplug.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Unlike antigen, zplug requires no ZSH plugin file (`*.plugin.zsh`).
It's such a fantabulous piece of software.
* Can manage everything
** Zsh plugins/UNIX commands on https://github.com[GitHub]
** Zsh plugins/UNIX commands on https://github.com[GitHub], https://gitlab.com[Gitlab],
and https://bitbucket.org[Bitbucket]
** Gist file (https://gist.github.com[gist.github.com])
** Third-party sources e.g.,
Expand Down Expand Up @@ -123,7 +123,7 @@ and so on. If you want to use extended glob, see later section for setting the z
`use:"*darwin*"`

|*from* | Specify the service from which you install
| `github`,`bitbucket`,`gh-r`,`gist`,
| `github`, `gitlab`,`bitbucket`,`gh-r`,`gist`,
`oh-my-zsh`,`prezto`,`local` (`github`) | `from:gh-r`

|*at* | Branch, tag, or commit to use | *revision* (`master`) | `at:v1.5.6`
Expand Down Expand Up @@ -338,6 +338,11 @@ zplug "b4b4r07/hello_bitbucket", \
hook-build:"chmod 755 *.sh", \
use:"*.sh"
# Support Gitlab
zplug "willemmali-sh/chegit", \
as:command, \
from:gitlab
# Group dependencies, emoji-cli depends on jq in this example
zplug "stedolan/jq", \
as:command, \
Expand Down
2 changes: 1 addition & 1 deletion misc/completions/_zplug
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ case "$words[1]" in
_values -S : -s , "zplug tags" \
"as[$_zplug_tags[as]]:as:(plugin command theme)" \
"use[$_zplug_tags[use]]:use:->use" \
"from[$_zplug_tags[from]]:from:(gh-r gist oh-my-zsh github bitbucket local)" \
"from[$_zplug_tags[from]]:from:(gh-r gist oh-my-zsh github gitlab bitbucket local)" \
"at[$_zplug_tags[at]]:at:" \
"rename-to[$_zplug_tags[rename-to]]:rename-to:" \
"dir[$_zplug_tags[dir]]:dir:->dir" \
Expand Down

0 comments on commit 9819d03

Please sign in to comment.