From 390fd8f8e3face1ecaccc5cf731fd07780138374 Mon Sep 17 00:00:00 2001 From: Ilya Ryzhenkov Date: Wed, 15 Oct 2014 13:07:13 +0400 Subject: Ignore non-existing include file. --- src/main.kt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main.kt b/src/main.kt index 6f5cf796..6136300f 100644 --- a/src/main.kt +++ b/src/main.kt @@ -83,10 +83,15 @@ public fun main(args: Array) { val moduleContent = Content() for (include in includes) { - val text = File(include).readText() - val tree = MarkdownProcessor.parse(text) - val content = buildContent(tree, session.getPackageFragment(FqName.ROOT)) - moduleContent.children.addAll(content.children) + val file = File(include) + if (file.exists()) { + val text = file.readText() + val tree = MarkdownProcessor.parse(text) + val content = buildContent(tree, session.getPackageFragment(FqName.ROOT)) + moduleContent.children.addAll(content.children) + } else { + println("WARN: Include file $file was not found.") + } } val documentationModule = DocumentationModule(arguments.moduleName, moduleContent) -- cgit