mirror of
https://github.com/oh-my-fish/oh-my-fish
synced 2024-11-03 15:40:32 +00:00
Merge pull request #511 from ohspite/api-error-handling
Fix error handling when github API is unavailable.
This commit is contained in:
commit
0f553bb7fb
@ -19,12 +19,12 @@ function omf.remote --argument-names options -d 'List remote plugins and themes'
|
|||||||
|
|
||||||
if echo $page_count | grep -vE '^[0-9]+$'
|
if echo $page_count | grep -vE '^[0-9]+$'
|
||||||
echo "Could not access Github API" >&2
|
echo "Could not access Github API" >&2
|
||||||
exit 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
set repos ""
|
set repos ""
|
||||||
for i in (seq $page_count)
|
for i in (seq $page_count)
|
||||||
set answer (curl -s "$url?page=$i&per_page=100" | grep \"name\" | tr \": " " | awk '{print $2}')
|
set answer (curl -s "$url?page=$i&per_page=100" | grep '"name"' | tr '":' " " | awk '{print $2}')
|
||||||
set repos "$answer $repos"
|
set repos "$answer $repos"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user