Skip to content
Snippets Groups Projects
Verified Commit 4a89ad9c authored by nd's avatar nd
Browse files

sort files and folders

parent ff7ab2ae
Branches
Tags
No related merge requests found
Pipeline #9501 failed
......@@ -7,4 +7,4 @@ RUN apt-get -qq update && \
apt-get -qq install python3 python3-jinja2 && \
apt-get -qq clean
COPY directory-listening/create-index.py /usr/local/bin/create-directory-html-index
COPY directory listing/create-index.py /usr/local/bin/create-directory-html-index
......@@ -83,6 +83,8 @@ def main(inputfolder, outputfolder, ignore_files):
</html>
""")
for path, dirs, files in os.walk(inputfolder):
dirs.sort()
files.sort()
relativ_path_to_input = os.path.relpath(path, inputfolder)
entries = [(i, os.stat(os.path.join(path, i)), i in dirs) for i in dirs+files if not i in ignore_files]
html_index = template.render(path=relativ_path_to_input, entries=entries)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment