From 3835f86fdefe007d354aeca6da1a0372e3601f42 Mon Sep 17 00:00:00 2001 From: Alexander Gorshenev Date: Thu, 20 Sep 2018 20:00:32 +0300 Subject: [PATCH] Minor fixes to klib utility. --- klib/src/main/kotlin/org/jetbrains/kotlin/cli/klib/main.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/klib/src/main/kotlin/org/jetbrains/kotlin/cli/klib/main.kt b/klib/src/main/kotlin/org/jetbrains/kotlin/cli/klib/main.kt index 25e9517dd73..89be7869b47 100644 --- a/klib/src/main/kotlin/org/jetbrains/kotlin/cli/klib/main.kt +++ b/klib/src/main/kotlin/org/jetbrains/kotlin/cli/klib/main.kt @@ -112,6 +112,11 @@ class Library(val name: String, val requestedRepository: String?, val target: St } fun install() { + if (!repository.exists) { + warn("Repository does not exist: $repository. Creating.") + repository.mkdirs() + } + Library(File(name).name.removeSuffix(KLIB_FILE_EXTENSION_WITH_DOT), requestedRepository, target).remove(true) val library = libraryInCurrentDir(name) @@ -185,8 +190,6 @@ fun main(args: Array) { val library = Library(command.library, repository, target) - warn("IMPORTANT: the library format is unstable now. It can change with any new git commit without warning!") - when (command.verb) { "contents" -> library.contents() "info" -> library.info()