aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Borner2019-04-07 18:10:42 +0200
committerMarvin Borner2019-04-07 18:10:42 +0200
commit6703b0859c2e32c38cb93515b9af43e390c4f8ca (patch)
tree70ffbd20581bcfe456632ec5d05b303fa4aa0881
parent5ec7ec5c50eeb3e2c281c0edfee6c74d7d512500 (diff)
Added sorting of files
-rw-r--r--src/main/kotlin/App.kt13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/main/kotlin/App.kt b/src/main/kotlin/App.kt
index f69a960..dde993a 100644
--- a/src/main/kotlin/App.kt
+++ b/src/main/kotlin/App.kt
@@ -77,13 +77,14 @@ fun crawlFiles(ctx: Context) {
.drop(fileHome.length + (if (ctx.splats()[0].isNotEmpty()) ctx.splats()[0].length + 2 else 1))
val filePath = "$fileHome${it.toString().drop(fileHome.length)}"
files.add(if (File(filePath).isDirectory) "$fileName/" else fileName)
- ctx.render(
- "files.rocker.html", model(
- "files", files,
- "path", ctx.splats()[0]
- )
- )
}
+ files.sortWith(String.CASE_INSENSITIVE_ORDER)
+ ctx.render(
+ "files.rocker.html", model(
+ "files", files,
+ "path", ctx.splats()[0]
+ )
+ )
} else
ctx.render(
"fileview.rocker.html", model(