Skip to content

Commit

Permalink
Add GitLab support (#658)
Browse files Browse the repository at this point in the history
Close #658.
  • Loading branch information
jorgebucaran committed Jun 19, 2022
2 parents bad0471 + a0a68de commit daddbad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -29,6 +29,8 @@ Install plugins using the `install` command followed by the path to the reposito
fisher install jorgebucaran/nvm.fish
```

> To install a plugin from GitLab, prefix the repository with `gitlab.com/`.
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
Expand Down
6 changes: 6 additions & 0 deletions functions/fisher.fish
Expand Up @@ -91,6 +91,12 @@ function fisher --argument-names cmd --description "A plugin manager for Fish"
set url https://api.github.com/repos/\$name[1]/tarball/\$name[2]
set header 'Accept: application/vnd.github.v3+json'
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[2]}-{\$name[2]}.tar.gz
end
echo Fetching (set_color --underline)\$url(set_color normal)
if curl --silent -L -H \$header \$url | tar -xzC \$temp -f - 2>/dev/null
Expand Down

0 comments on commit daddbad

Please sign in to comment.