mirror of
https://github.com/jorgebucaran/fisher
synced 2024-11-11 01:10:44 +00:00
improve index file parsing (#412)
* use match() to extract substrings * match only horizontal whitespaces
This commit is contained in:
parent
79fc2e6f6b
commit
b7b8a1339a
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 New Issue
Block a user