Skip to content

Commit

Permalink
Rename main template ino file
Browse files Browse the repository at this point in the history
  • Loading branch information
gsingh93 committed Oct 19, 2023
1 parent 4c89403 commit 1cd159d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions commands/sketch/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ func NewSketch(ctx context.Context, req *rpc.NewSketchRequest) (*rpc.NewSketchRe
if err := templateDirPath.CopyDirTo(sketchDirPath); err != nil {
return nil, &arduino.CantCreateSketchError{Cause: err}
}

oldMainFilePath := sketchDirPath.Join(templateDirPath.Base() + globals.MainFileValidExtension)
if err := oldMainFilePath.Rename(sketchMainFilePath); err != nil {
return nil, &arduino.CantCreateSketchError{Cause: err}
}
} else {
if err := sketchDirPath.MkdirAll(); err != nil {
return nil, &arduino.CantCreateSketchError{Cause: err}
Expand Down

0 comments on commit 1cd159d

Please sign in to comment.