Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ff796f3 commit de7c948Copy full SHA for de7c948
commands/sketch/new.go
@@ -65,6 +65,11 @@ func NewSketch(ctx context.Context, req *rpc.NewSketchRequest) (*rpc.NewSketchRe
65
if err := templateDirPath.CopyDirTo(sketchDirPath); err != nil {
66
return nil, &arduino.CantCreateSketchError{Cause: err}
67
}
68
+
69
+ oldMainFilePath := sketchDirPath.Join(templateDirPath.Base() + globals.MainFileValidExtension)
70
+ if err := oldMainFilePath.Rename(sketchMainFilePath); err != nil {
71
+ return nil, &arduino.CantCreateSketchError{Cause: err}
72
+ }
73
} else {
74
if err := sketchDirPath.MkdirAll(); err != nil {
75
0 commit comments