1
0
Fork 0
mirror of https://github.com/zplug/zplug synced 2024-05-17 21:16:37 +02:00

Merge pull request #330 from iladin/master

Add gitlab support
This commit is contained in:
zplug-man 2017-01-18 13:24:35 +09:00 committed by GitHub
commit 9819d039cf
7 changed files with 69 additions and 10 deletions

47
base/sources/gitlab.zsh Normal file
View File

@ -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)
# git@gitlab.com:%s.git
url_format="git@gitlab.com:${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[@]"
}

View File

@ -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

View File

@ -53,7 +53,8 @@ Can manage everything
.IP \(bu 2.3
.\}
Zsh plugins/UNIX commands on
GitHub
GitHub,
Gitlab
and
Bitbucket
.RE
@ -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
@ -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

View File

@ -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

View File

@ -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:

View File

@ -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.,
@ -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`
@ -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, \

View File

@ -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" \