mirror of
https://github.com/jorgebucaran/fisher
synced 2024-10-09 09:36:53 +02:00
improve index file parsing (#412)
* use match() to extract substrings * match only horizontal whitespaces
This commit is contained in:
parent
494733f948
commit
fa7d68906e
1 changed files with 6 additions and 6 deletions
12
fisher.fish
12
fisher.fish
|
@ -1166,16 +1166,16 @@ function __fisher_remote_index_update
|
|||
}
|
||||
|
||||
{
|
||||
if ($0 ~ /^name: /) {
|
||||
name = substr($0, 7)
|
||||
if (match($0, /^name:[[:blank:]]*/)) {
|
||||
name = substr($0, RLENGTH+1)
|
||||
}
|
||||
|
||||
if ($0 ~ /^description: /) {
|
||||
info = substr($0, 14)
|
||||
if (match($0, /^description:[[:blank:]]*/)) {
|
||||
description = substr($0, RLENGTH+1)
|
||||
}
|
||||
|
||||
if ($0 ~ /^stargazers_count: /) {
|
||||
stars = substr($0, 19)
|
||||
if (match($0, /^stargazers_count:[[:blank:]]*/)) {
|
||||
stars = substr($0, RLENGTH+1)
|
||||
}
|
||||
|
||||
if (name != "" && stars != "") {
|
||||
|
|
Loading…
Reference in a new issue