Skip to content

Commit 866c7f8

Browse files
committed
Sketchbook fixes
1 parent adda041 commit 866c7f8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/src/processing/app/api/Sketch.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Sketch {
2525

2626
fun getSketches(file: File, filter: (File) -> Boolean = { true }): Folder {
2727
val name = file.name
28-
val (sketchesFolders, childrenFolders) = file.listFiles()?.partition { isSketchFolder(it) } ?: return Folder(
28+
val (sketchesFolders, childrenFolders) = file.listFiles()?.filter (File::isDirectory)?.partition { isSketchFolder(it) } ?: return Folder(
2929
name = name,
3030
path = file.absolutePath,
3131
sketches = emptyList(),

app/src/processing/app/api/Sketchbook.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Sketchbook: SuspendingCliktCommand() {
3434
// TODO: Currently blocked since `Base.getSketchbookFolder()` is not available in headless mode
3535
val sketchbookFolder = Platform.getDefaultSketchbookFolder()
3636

37-
val sketches = getSketches(sketchbookFolder.resolve("sketchbook"))
37+
val sketches = getSketches(sketchbookFolder)
3838
val json = serializer.encodeToString(listOf(sketches))
3939
println(json)
4040
}

0 commit comments

Comments
 (0)