mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-13 02:42:45 +00:00
display a file when the folder contains only one file
This commit is contained in:
@@ -312,6 +312,8 @@ class Anonymous_Github:
|
||||
if f.path.lower() == "readme.md" or f.path.lower() == "index.html":
|
||||
current_file = get_element_from_path(g_repo, os.path.join(path, f.path))
|
||||
break
|
||||
if len(files.tree) == 1:
|
||||
current_file = get_element_from_path(g_repo, os.path.join(path, files.tree[0].path))
|
||||
return files, current_file
|
||||
|
||||
@application.route('/repository/<id>', methods=['GET'], defaults={'path': ''})
|
||||
|
||||
Reference in New Issue
Block a user