aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-10-15 13:07:13 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-10-15 13:07:13 +0400
commit390fd8f8e3face1ecaccc5cf731fd07780138374 (patch)
tree6dd7160cf1c4c6af40d23c0865809ca46ec12121
parent4907736abf96bf04b8e23a6772f0411936cb2008 (diff)
downloaddokka-390fd8f8e3face1ecaccc5cf731fd07780138374.tar.gz
dokka-390fd8f8e3face1ecaccc5cf731fd07780138374.tar.bz2
dokka-390fd8f8e3face1ecaccc5cf731fd07780138374.zip
Ignore non-existing include file.
-rw-r--r--src/main.kt13
1 files 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<String>) {
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)