Explorar el Código

sorted files by name

Igor Voynov hace 8 años
padre
commit
4372e4c8a2
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      Sources/Files.swift

+ 2 - 1
Sources/Files.swift

@@ -55,7 +55,8 @@ public func directoryBrowser(_ dir: String) -> ((HttpRequest) -> HttpResponse) {
                 return .notFound
             }
             if try filePath.directory() {
-                let files = try filePath.files()
+                var files = try filePath.files()
+                files.sort(by: {$0.lowercased() < $1.lowercased()})
                 return scopes {
                     html {
                         body {