diff --git a/commands/compile/compile.go b/commands/compile/compile.go index b68e4889fa1..e182a66ba01 100644 --- a/commands/compile/compile.go +++ b/commands/compile/compile.go @@ -181,7 +181,11 @@ func Compile(ctx context.Context, req *rpc.CompileReq, outStream io.Writer, errS var exportPath *paths.Path var exportFile string if req.GetExportFile() == "" { - exportPath = sketch.FullPath + if sketch.FullPath.IsDir() { + exportPath = sketch.FullPath + } else { + exportPath = sketch.FullPath.Parent() + } exportFile = sketch.Name + "." + fqbnSuffix } else { exportPath = paths.New(req.GetExportFile()).Parent()