From 851d49efbd12d1648d5548ad01da300ddde69742 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Mon, 28 Jan 2019 18:03:40 +0100 Subject: [PATCH] Correctly handle sketch.FullPath during export --- commands/compile/compile.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/commands/compile/compile.go b/commands/compile/compile.go index 2b604ececf7..a6a194bbba5 100644 --- a/commands/compile/compile.go +++ b/commands/compile/compile.go @@ -257,7 +257,11 @@ func run(cmd *cobra.Command, args []string) { var exportPath *paths.Path var exportFile string if flags.exportFile == "" { - exportPath = sketch.FullPath + if sketch.FullPath.IsDir() { + exportPath = sketch.FullPath + } else { + exportPath = sketch.FullPath.Parent() + } exportFile = sketch.Name + "." + fqbnSuffix } else { exportPath = paths.New(flags.exportFile).Parent()