@@ -23,6 +23,7 @@ import (
23
23
"github.com/arduino/arduino-cli/arduino/libraries"
24
24
"github.com/arduino/arduino-cli/arduino/libraries/librariesindex"
25
25
"github.com/arduino/arduino-cli/arduino/utils"
26
+ rpc "github.com/arduino/arduino-cli/rpc/commands"
26
27
paths "github.com/arduino/go-paths-helper"
27
28
"github.com/pmylund/sortutil"
28
29
"github.com/sirupsen/logrus"
@@ -43,7 +44,7 @@ type LibrariesManager struct {
43
44
// LibrariesDir is a directory containing libraries
44
45
type LibrariesDir struct {
45
46
Path * paths.Path
46
- Location libraries .LibraryLocation
47
+ Location rpc .LibraryLocation
47
48
PlatformRelease * cores.PlatformRelease
48
49
}
49
50
@@ -122,7 +123,7 @@ func (sc *LibrariesManager) LoadIndex() error {
122
123
// AddLibrariesDir adds path to the list of directories
123
124
// to scan when searching for libraries. If a path is already
124
125
// in the list it is ignored.
125
- func (sc * LibrariesManager ) AddLibrariesDir (path * paths.Path , location libraries .LibraryLocation ) {
126
+ func (sc * LibrariesManager ) AddLibrariesDir (path * paths.Path , location rpc .LibraryLocation ) {
126
127
for _ , dir := range sc .LibrariesDir {
127
128
if dir .Path .EquivalentTo (path ) {
128
129
return
@@ -138,7 +139,7 @@ func (sc *LibrariesManager) AddLibrariesDir(path *paths.Path, location libraries
138
139
// AddPlatformReleaseLibrariesDir add the libraries directory in the
139
140
// specified PlatformRelease to the list of directories to scan when
140
141
// searching for libraries.
141
- func (sc * LibrariesManager ) AddPlatformReleaseLibrariesDir (plaftormRelease * cores.PlatformRelease , location libraries .LibraryLocation ) {
142
+ func (sc * LibrariesManager ) AddPlatformReleaseLibrariesDir (plaftormRelease * cores.PlatformRelease , location rpc .LibraryLocation ) {
142
143
path := plaftormRelease .GetLibrariesDir ()
143
144
if path == nil {
144
145
return
@@ -168,7 +169,7 @@ func (sc *LibrariesManager) RescanLibraries() error {
168
169
169
170
func (sc * LibrariesManager ) getUserLibrariesDir () * paths.Path {
170
171
for _ , dir := range sc .LibrariesDir {
171
- if dir .Location == libraries . User {
172
+ if dir .Location == rpc . LibraryLocation_user_dir {
172
173
return dir .Path
173
174
}
174
175
}
@@ -216,7 +217,7 @@ func (sc *LibrariesManager) FindByReference(libRef *librariesindex.Reference) *l
216
217
// TODO: Move "search into user" into another method...
217
218
if libRef .Version == nil {
218
219
for _ , candidate := range alternatives .Alternatives {
219
- if candidate .Location == libraries . User {
220
+ if candidate .Location == rpc . LibraryLocation_user_dir {
220
221
return candidate
221
222
}
222
223
}
0 commit comments