From 7cc18f8ca8020cb7dbf9aac46b35d07594314ae3 Mon Sep 17 00:00:00 2001 From: Victor Häggqvist Date: Wed, 9 Dec 2015 23:08:01 +0100 Subject: catch empty search --- giti | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/giti b/giti index 819d2f7..4023c07 100755 --- a/giti +++ b/giti @@ -50,6 +50,10 @@ def search_for_file(kind: str) -> str: print("Found match {}".format(name)) return cont['items'][i]['path'] + if len(cont['items']) < 1: + print("Search found nothing") + return None + print('One of these might be good:') for i in range(0, len(cont['items'])): name = cont['items'][i]['name'].split('.')[0] -- cgit v1.2.3