@@ -122,13 +122,24 @@ def get_boards(boardstxt):
122
122
libpaths [line ["location" ]] = pathlib .Path (line ["dir" ])
123
123
124
124
# platform lib path is already known, obviously, since that's where this script resides
125
- userlibs = pathlib .Path (libpaths ["user" ])
126
- if userlibs .exists ():
127
- userlibs = userlibs .resolve ()
128
- libs = [u .name for u in userlibs .iterdir () if u .is_dir ()]
125
+ if "user" in libpaths .keys ():
126
+ userlibs = pathlib .Path (libpaths ["user" ])
127
+ if userlibs .exists ():
128
+ userlibs = userlibs .resolve ()
129
+ libs = [u .name for u in userlibs .iterdir () if u .is_dir ()]
130
+ else :
131
+ print (
132
+ f"""Warning: Cannot find { userlibs } .
133
+ This has likely to do with your arduino-cli configuration.
134
+ Please refer to the following link for setup details:
135
+ https://arduino.github.io/arduino-cli/latest/getting-started/#create-a-configuration-file
136
+ """
137
+ )
138
+ libs = list ()
129
139
else :
140
+ userlibs = pathlib .Path .home () / "Arduino/libraries"
130
141
print (
131
- f"""Warning: Cannot find { userlibs } .
142
+ f"""No user library path found through arduino-cli (falling back to { userlibs } ) .
132
143
This has likely to do with your arduino-cli configuration.
133
144
Please refer to the following link for setup details:
134
145
https://arduino.github.io/arduino-cli/latest/getting-started/#create-a-configuration-file
@@ -197,7 +208,7 @@ def get_boards(boardstxt):
197
208
For details, please refer to
198
209
https://github.com/stm32duino/wiki/wiki/Arduino-%28in%29compatibility#library-management
199
210
"""
200
- )
211
+ )
201
212
202
213
if shargs .fire :
203
214
if not (shargs .sketch and shargs .board ):
0 commit comments