Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Enable creating new sketches from a template directory #2359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: master
Choose a base branch
Loading
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Rename main template ino file
  • Loading branch information
gsingh93 committed Oct 19, 2023
commit de7c948f5471618ebcf277807c39d62411b5f49b
5 changes: 5 additions & 0 deletions 5 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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.