mirror of
https://github.com/jorgebucaran/fisher
synced 2024-08-17 12:31:05 +02:00
Prevent additional remotes per plugin from affecting fishfile
closes #371
This commit is contained in:
parent
99702cf739
commit
21c1cb62d9
1 changed files with 20 additions and 18 deletions
38
fisher.fish
38
fisher.fish
|
@ -1644,26 +1644,28 @@ function __fisher_plugin_get_url_info -a option
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
command cat {$argv}/.git/config ^ /dev/null | command awk -v option="$option" '
|
for dir in $argv
|
||||||
/url/ {
|
git -C $dir config remote.origin.url ^ /dev/null | command awk -v option="$option" '
|
||||||
n = split($3, s, "/")
|
{
|
||||||
|
n = split($0, s, "/")
|
||||||
|
|
||||||
if ($3 ~ /https:\/\/gist/) {
|
if ($0 ~ /https:\/\/gist/) {
|
||||||
printf("# %s\n", $3)
|
printf("# %s\n", $0)
|
||||||
next
|
next
|
||||||
|
}
|
||||||
|
|
||||||
|
if (option == "--dirname") {
|
||||||
|
printf("%s\n", s[n - 1])
|
||||||
|
|
||||||
|
} else if (option == "--basename") {
|
||||||
|
printf("%s\n", s[n])
|
||||||
|
|
||||||
|
} else {
|
||||||
|
printf("%s/%s\n", s[n - 1], s[n])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
'
|
||||||
if (option == "--dirname") {
|
end
|
||||||
printf("%s\n", s[n - 1])
|
|
||||||
|
|
||||||
} else if (option == "--basename") {
|
|
||||||
printf("%s\n", s[n])
|
|
||||||
|
|
||||||
} else {
|
|
||||||
printf("%s/%s\n", s[n - 1], s[n])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue