1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00

Better error message.

This commit is contained in:
Cedric Beust 2017-03-30 11:58:27 -07:00
parent fca974779d
commit b354b42767
2 changed files with 4 additions and 0 deletions

View file

@ -19,6 +19,7 @@ class SingleFileBuildSources(val file: File) : IBuildSources {
override fun exists() = file.exists() override fun exists() = file.exists()
override fun findSourceFiles() = listOf(file) override fun findSourceFiles() = listOf(file)
override val root: File = file.parentFile.parentFile.parentFile override val root: File = file.parentFile.parentFile.parentFile
override fun toString() : String = file.path
} }
class BuildSources(val file: File = File("")) : IBuildSources { class BuildSources(val file: File = File("")) : IBuildSources {

View file

@ -117,6 +117,9 @@ class Options @Inject constructor(
// //
// Launch the build // Launch the build
// //
if (! buildSources.exists()) {
throw KobaltException("Could not find build file: " + buildSources)
}
val runTargetResult = taskManager.runTargets(args.targets, allProjects) val runTargetResult = taskManager.runTargets(args.targets, allProjects)
if (result == 0) { if (result == 0) {
result = if (runTargetResult.taskResult.success) 0 else 1 result = if (runTargetResult.taskResult.success) 0 else 1