Browse Source

Merge pull request #279 from voynovia/feature/sort-files

sorted files by name
Damian Kołakowski 8 năm trước cách đây
mục cha
commit
8dad939700
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  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 {