diff options
author | Victor Häggqvist <[email protected]> | 2015-12-09 23:06:21 +0100 |
---|---|---|
committer | Victor Häggqvist <[email protected]> | 2015-12-09 23:06:21 +0100 |
commit | dfcdca379234a648f277d70aa0cc98d5b84b5645 (patch) | |
tree | d02433810d07eefdd2103fdfc4958295618da641 | |
parent | eb66398e806d2204b5181ca837527ffb8eb46dc9 (diff) |
check search results with ignored case
-rwxr-xr-x | giti | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -43,6 +43,13 @@ def search_for_file(kind: str) -> str: r = requests.get('https://api.github.com/search/code?q=repo:github/gitignore %s' % kind, headers=headers) cont = r.json() + # Check is any result match when ignoring case + for i in range(0, len(cont['items'])): + name = cont['items'][i]['name'].split('.')[0] + if name.lower() == kind.lower(): + print("Found match {}".format(name)) + return cont['items'][i]['path'] + print('One of these might be good:') for i in range(0, len(cont['items'])): name = cont['items'][i]['name'].split('.')[0] |