mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-07-10 15:38:35 +02: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":
|
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))
|
current_file = get_element_from_path(g_repo, os.path.join(path, f.path))
|
||||||
break
|
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
|
return files, current_file
|
||||||
|
|
||||||
@application.route('/repository/<id>', methods=['GET'], defaults={'path': ''})
|
@application.route('/repository/<id>', methods=['GET'], defaults={'path': ''})
|
||||||
|
|||||||
Reference in New Issue
Block a user