From 3a68bd0dd7261a7b0f015c2b79674c133d3fac00 Mon Sep 17 00:00:00 2001 From: Don Date: Tue, 25 Aug 2015 21:13:35 -0400 Subject: [PATCH] Fix error handling when github API is unavailable. The `exit` (instead of `return`) caused the shell to quit if there was an error with github. --- plugins/omf/omf.remote.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/omf/omf.remote.fish b/plugins/omf/omf.remote.fish index c660ca8..00433af 100644 --- a/plugins/omf/omf.remote.fish +++ b/plugins/omf/omf.remote.fish @@ -19,12 +19,12 @@ function omf.remote --argument-names options -d 'List remote plugins and themes' if echo $page_count | grep -vE '^[0-9]+$' echo "Could not access Github API" >&2 - exit 1 + return 1 end set repos "" 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" end