Skip to content

Commit

Permalink
Fixed loading of Library given a non-absolute path
Browse files Browse the repository at this point in the history
Givin a relative path is not ideal, but at least allows the CLI to
compile the sketch correctly.
  • Loading branch information
cmaglie committed Aug 16, 2023
1 parent 246adf9 commit 687b505
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions arduino/libraries/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ import (

// Load loads a library from the given LibraryLocation
func Load(libDir *paths.Path, location LibraryLocation) (*Library, error) {
if !libDir.IsAbs() {
if abs, err := libDir.Abs(); err == nil {
libDir = abs
} else {
return nil, err
}
}
if libDir.Join("library.properties").Exist() {
return makeNewLibrary(libDir, location)
}
Expand Down

0 comments on commit 687b505

Please sign in to comment.