@@ -122,13 +122,24 @@ def get_boards(boardstxt):
122122 libpaths [line ["location" ]] = pathlib .Path (line ["dir" ])
123123
124124# 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 ()
129139else :
140+ userlibs = pathlib .Path .home () / "Arduino/libraries"
130141 print (
131- f"""Warning: Cannot find { userlibs } .
142+ f"""No user library path found through arduino-cli (falling back to { userlibs } ) .
132143 This has likely to do with your arduino-cli configuration.
133144 Please refer to the following link for setup details:
134145 https://arduino.github.io/arduino-cli/latest/getting-started/#create-a-configuration-file
@@ -197,7 +208,7 @@ def get_boards(boardstxt):
197208For details, please refer to
198209https://github.com/stm32duino/wiki/wiki/Arduino-%28in%29compatibility#library-management
199210 """
200- )
211+ )
201212
202213if shargs .fire :
203214 if not (shargs .sketch and shargs .board ):
0 commit comments