Add GitLab support.

Add the possibility to add plugins from gitlab. Resolves #657.
pull/658/head
Daniël Franke 3 years ago
parent 56c629a3a9
commit 8ae139dc9e
No known key found for this signature in database
GPG Key ID: 5958AFD73D7A08E8

@ -31,6 +31,12 @@ Install plugins using the `install` command followed by the path to the reposito
fisher install ilancosman/tide
```
To install a plugin from GitLab, prefix `gitlab.com/`.
```console
fisher install gitlab.com/ainmosni/fish-aws
```
To get a specific version of a plugin add an `@` symbol after the plugin name followed by a tag, branch, or [commit](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefcommit-ishacommit-ishalsocommittish).
```console

@ -84,6 +84,12 @@ function fisher --argument-names cmd --description "A plugin manager for Fish"
set name (string split \@ $plugin) || set name[2] HEAD
set url https://codeload.github.com/\$name[1]/tar.gz/\$name[2]
if string match -q 'gitlab.com/*' \$name[1]
set bare (string replace 'gitlab.com/' '' \$name[1])
set repo (string split '/' \$bare)
set url https://gitlab.com/{\$bare}/-/archive/{\$name[2]}/{\$repo[1]}-{\$name[2]}.tar.gz
end
echo Fetching (set_color --underline)\$url(set_color normal)
if curl --silent \$url | tar --extract --gzip --directory \$temp --file - 2>/dev/null

Loading…
Cancel
Save