Skip to content

Use a local Walk function #421

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

Merged
merged 17 commits into from
Oct 29, 2019
Prev Previous commit
Next Next commit
check sketch is not a directory
  • Loading branch information
d-a-v committed Sep 23, 2019
commit 75ffd4f94488d9672a7ec7b64f31a0a14210e37d
10 changes: 8 additions & 2 deletions arduino/builder/sketch.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,18 @@ func SketchLoad(sketchPath, buildPath string) (*sketch.Sketch, error) {
sketchFolder = sketchPath
mainSketchFile = filepath.Join(sketchPath, stat.Name()+".ino")
// in the case a dir was passed, ensure the main file exists and is readable
info, err := os.Stat(mainSketchFile)
f, err := os.Open(mainSketchFile)
if err != nil {
return nil, errors.Wrap(err, "unable to find the main sketch file")
}
f.Close()
// ensure it is not a directory
info, err := os.Stat(mainSketchFile)
if err != nil {
return nil, errors.Wrap(err, "unable to check the main sketch file")
}
if info.IsDir() {
return nil, errors.Wrap(errors.New(mainSketchFile), "sketch must be a file")
return nil, errors.Wrap(errors.New(mainSketchFile), "sketch must not be a directory")
}
} else {
sketchFolder = filepath.Dir(sketchPath)
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy