From bba922a168fde8ce7933207fa4b4c3cb13ed9a67 Mon Sep 17 00:00:00 2001 From: Colin Date: Mon, 22 Mar 2021 10:24:48 -0400 Subject: [PATCH] Fixed default output directory when input is just file name. --- makina-compiler/src/xyz/colinholzman/makina/Main.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makina-compiler/src/xyz/colinholzman/makina/Main.kt b/makina-compiler/src/xyz/colinholzman/makina/Main.kt index 16cf83b..571371d 100644 --- a/makina-compiler/src/xyz/colinholzman/makina/Main.kt +++ b/makina-compiler/src/xyz/colinholzman/makina/Main.kt @@ -14,7 +14,7 @@ fun main(args: Array) { try { val machine = Parse.file(file) - val outputDirectoryPath = options.outputDir ?: Paths.get(file).parent.toString() + val outputDirectoryPath = options.outputDir ?: (Paths.get(file).parent ?: ".").toString() val outputDirectory = File(outputDirectoryPath) if (!outputDirectory.exists()) outputDirectory.mkdirs()